Files

28 lines
8.9 KiB
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>ESP32-S3 C64 READY Cheat Sheet</title><style>:root{--bg:#17123b;--p:#40318d;--a:#7869c4;--t:#ded8ff;--c:#100c2b;--l:#6657ae}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--t);font:15px/1.55 Consolas,monospace}header{padding:60px 20px;background:var(--p);border-bottom:8px solid var(--a)}.w{max-width:1080px;margin:auto}h1{font-size:clamp(38px,8vw,86px);line-height:.9;margin:0;color:#fff;text-shadow:5px 5px #211765}header p{color:#c5bced}nav{position:sticky;top:0;background:#211765ee;padding:10px;z-index:2;text-align:center}nav a{color:#fff;margin:0 8px}.grid{display:grid;grid-template-columns:1fr 1fr;gap:16px;padding:32px 16px}.card{background:var(--p);padding:20px;border:1px solid var(--l);box-shadow:6px 6px var(--c)}.wide{grid-column:1/-1}h2{margin-top:0;color:#fff}h3{color:#c5bced}pre{position:relative;background:var(--c);border-left:4px solid var(--a);padding:14px 55px 14px 14px;overflow:auto;white-space:pre-wrap}.copy{position:absolute;right:7px;top:7px;background:var(--p);color:#fff;border:1px solid var(--l);padding:4px;cursor:pointer}code{font-family:inherit}table{width:100%;border-collapse:collapse}th,td{text-align:left;vertical-align:top;padding:9px;border-bottom:1px solid var(--l)}td code,.pill{background:var(--c);padding:2px 5px;color:#fff}.tree{background:var(--c);padding:16px;white-space:pre;overflow:auto}.timeline{list-style:none;padding:0}.timeline li{display:grid;grid-template-columns:90px 1fr;gap:14px;padding:10px 0;border-bottom:1px solid var(--l)}.hash{color:#91e0ae}.note{background:#211765;border-left:4px solid #91e0ae;padding:12px}footer{text-align:center;padding:30px;color:#aaa0d7}@media(max-width:740px){.grid{grid-template-columns:1fr}.wide{grid-column:auto}.timeline li{grid-template-columns:1fr}}</style></head><body><header><div class="w"><div>WAVESHARE ESP32-S3-TOUCH-LCD-3.49</div><h1>READY.</h1><p>Build · Upload · Git · Gitea · Files · Commits</p></div></header><nav><a href="#quick">Quick start</a><a href="#repo">Repository</a><a href="#files">Files</a><a href="#commits">Commits</a><a href="#c64">C64 values</a></nav><main class="w grid"><section class="card wide" id="quick"><h2>Quick start</h2><p><span class="pill">S:\mgCode\waveshare-c64-ready</span> <span class="pill">COM43</span> <span class="pill">main</span></p><h3>Build</h3><pre><code>cd S:\mgCode\waveshare-c64-ready
C:\Users\Malko\.platformio\penv\Scripts\platformio.exe run</code><button class="copy">copy</button></pre><h3>Build and upload</h3><pre><code>C:\Users\Malko\.platformio\penv\Scripts\platformio.exe run --target upload --upload-port COM43</code><button class="copy">copy</button></pre><h3>Serial monitor</h3><pre><code>C:\Users\Malko\.platformio\penv\Scripts\platformio.exe device monitor --port COM43 --baud 115200</code><button class="copy">copy</button></pre></section><section class="card" id="repo"><h2>Create the local Git repository</h2><pre><code>mkdir S:\mgCode\waveshare-c64-ready
cd S:\mgCode\waveshare-c64-ready
git init -b main
git remote add origin https://codex.malko.net/helios/waveshare-c64-ready.git
git remote -v</code><button class="copy">copy</button></pre><h3>First commit and push</h3><pre><code>git add .
git commit -m "First working C64 READY screen"
git -c credential.username=helios push -u origin main</code><button class="copy">copy</button></pre><div class="note">Push-to-create is disabled on this Gitea server. Create the empty remote repository first.</div></section><section class="card"><h2>Create the Gitea repository by API</h2><p>Use a personal access token placeholder. Never save a real token in source control.</p><pre><code>$headers = @{ Authorization = "token &lt;GITEA_TOKEN&gt;" }
$body = @{ name="waveshare-c64-ready"; description="C64 READY screen for Waveshare ESP32-S3 LCD"; private=$false; auto_init=$false } | ConvertTo-Json
Invoke-RestMethod -Method Post -Uri "https://codex.malko.net/api/v1/user/repos" -Headers $headers -ContentType "application/json" -Body $body</code><button class="copy">copy</button></pre><h3>Detect the board port</h3><pre><code>Get-CimInstance Win32_SerialPort | Select-Object DeviceID,Name,PNPDeviceID</code><button class="copy">copy</button></pre><p>The board appeared as USB Serial Device <strong>COM43</strong>, VID 303A, PID 1001.</p></section><section class="card wide" id="files"><h2>Files and what changed</h2><div class="tree">waveshare-c64-ready/
├── platformio.ini ESP32-S3, 16 MB flash, OPI PSRAM, LVGL 8.4
├── README.md Build instructions and source links
├── cheat-sheet.html This portable reference page
└── src/
├── main.cpp I²C → LCD/LVGL → backlight startup
├── c64_ui.c C64 colors, ROM glyphs, cursor timer
├── c64_ui.h c64_ui_create() declaration
├── user_config.h Pins, 640×172 rotated dimensions
├── lvgl_port.c/.h Display flush, rotation, touch and LVGL task
├── i2c_bsp.c/.h I²C setup
├── axs15231b/ Official Waveshare LCD driver
├── lcd_bl_bsp/ Backlight PWM driver
└── touch/ Capacitive touch driver</div><table><tr><th>Task</th><th>File</th><th>Important setting</th></tr><tr><td>Rotate right 90°</td><td>src/user_config.h</td><td><code>#define Rotated USER_DISP_ROT_90</code></td></tr><tr><td>Use real C64 glyphs</td><td>src/c64_ui.c</td><td>8-byte uppercase/graphics ROM rows</td></tr><tr><td>PAL blink</td><td>src/c64_ui.c</td><td><code>lv_timer_create(cursor_blink, 400, cursor)</code></td></tr><tr><td>Show custom UI</td><td>src/lvgl_port.c</td><td><code>c64_ui_create()</code></td></tr><tr><td>Fix PlatformIO includes</td><td>src/lvgl_port.c</td><td>axs15231b/... and touch/...</td></tr></table></section><section class="card"><h2>Normal Git workflow</h2><pre><code>git status --short
git diff --check
git diff</code><button class="copy">copy</button></pre><pre><code>git add src/c64_ui.c src/user_config.h
git commit -m "Describe the change"
git -c credential.username=helios push origin main</code><button class="copy">copy</button></pre><pre><code>git log --oneline -3
git status --short</code><button class="copy">copy</button></pre><p>Remote: <a style="color:white" href="https://codex.malko.net/helios/waveshare-c64-ready">codex.malko.net/helios/waveshare-c64-ready</a></p></section><section class="card" id="c64"><h2>Final C64 values</h2><table><tr><th>Background</th><td>#40318D · RGB 64,49,141</td></tr><tr><th>Text/cursor</th><td>#7869C4 · RGB 120,105,196</td></tr><tr><th>Text</th><td>READY.</td></tr><tr><th>Font</th><td>C64 uppercase/graphics ROM, 8×8 raster glyphs</td></tr><tr><th>Cursor</th><td>Square cell on the line below</td></tr><tr><th>PAL timing</th><td>400 ms visible + 400 ms hidden</td></tr><tr><th>Rate</th><td>800 ms cycle · 1.25 blinks/second</td></tr></table><p>Formula: 20 system ticks ÷ 50 Hz = 0.40 seconds per state.</p></section><section class="card wide" id="commits"><h2>Commit history</h2><ol class="timeline"><li><span class="hash">c81cb49</span><span><strong>First working C64 READY screen</strong><br>PlatformIO project, Waveshare drivers, C64 palette and initial UI.</span></li><li><span class="hash">de99bf6</span><span><strong>Use rotated authentic C64 bitmap font</strong><br>90° rotation and exact character-ROM glyph bytes.</span></li><li><span class="hash">1fea7b1</span><span><strong>Maximize READY and set two-blink cursor</strong><br>Experimental full-width READY layout.</span></li><li><span class="hash">9dea865</span><span><strong>Restore READY layout and authentic cursor timing</strong><br>Restored READY. and cursor below.</span></li><li><span class="hash">631d3a1</span><span><strong>Keep cursor visible longer than hidden</strong><br>Experimental asymmetric timing.</span></li><li><span class="hash">88141a7</span><span><strong>Match PAL C64 cursor timing</strong><br>Final symmetric 400 ms on/off timing.</span></li></ol></section><section class="card wide"><h2>Troubleshooting</h2><table><tr><th>Upload cannot connect</th><td>Hold BOOT, tap RESET, release BOOT, retry and recheck COM port.</td></tr><tr><th>HTTP 403 on first push</th><td>Create the Gitea repository through UI/API before pushing.</td></tr><tr><th>Authentication failed</th><td>Refresh Gitea token/credential, retry the push.</td></tr><tr><th>Wrong Arduino include path</th><td>Remove the leading src/ when files already live beneath PlatformIO src/.</td></tr><tr><th>Clean rebuild</th><td><code>platformio.exe run --target clean</code>, then <code>platformio.exe run</code>.</td></tr></table></section></main><footer>READY. · ESP32-S3 C64 project cheat sheet · 2026-08-01</footer><script>document.querySelectorAll(".copy").forEach(function(b){b.onclick=function(){var t=b.previousElementSibling.innerText;navigator.clipboard.writeText(t).then(function(){b.textContent="copied";setTimeout(function(){b.textContent="copy"},1000)})}});</script></body></html>