<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0">
    <channel>
      <title>tiny blog</title>
      <link>https://blog.kc.is.being.pet</link>
      <description>where i put things that don&#39;t rly matter</description>
      <generator>Zola</generator>
      <language>en</language>
      <atom:link href="https://blog.kc.is.being.pet/rss.xml" rel="self" type="application/rss+xml"/>
      <lastBuildDate>Tue, 22 Sep 2026 00:00:00 +0000</lastBuildDate>
      <item>
          <title>Reading JourneyMap&#39;s chunk cache</title>
          <pubDate>Tue, 22 Sep 2026 00:00:00 +0000</pubDate>
          <author>Casey</author>
          <link>https://blog.kc.is.being.pet/posts/reading-journeymaps-chunk-cache/</link>
          <guid>https://blog.kc.is.being.pet/posts/reading-journeymaps-chunk-cache/</guid>
          <description xml:base="https://blog.kc.is.being.pet/posts/reading-journeymaps-chunk-cache/">&lt;blockquote class=&quot;markdown-alert-caution&quot;&gt;
&lt;p&gt;Unfinished article&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2 id=&quot;why-even&quot;&gt;Why even..&lt;/h2&gt;
&lt;p&gt;I&#39;ve been mapping out one Minecraft server hosted by some YTber that primarily plays on beta-like modpacks.&lt;/p&gt;
&lt;p&gt;That server was obviously themed like one as well, with some restrictions on what mods clients are allowed to use.
Most notably, no &quot;meta-gaming&quot;, even though ruleset doesn&#39;t necessarily explain that:&lt;/p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #CDD6F4; background-color: #1E1E2E;&quot; &gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;------------------[ 1 / 2 ]------------------&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;No cheating!&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;No major/consistent griefing! (lava casts, base destruction, etc.)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;No consistent stealing! (stealing from players chests regularly)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Beefing is allowed if the third side is not included&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                      Next &amp;gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;---------------------------------------------&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;------------------[ 2 / 2 ]------------------&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Occasional theft is allowed&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Occasional/light griefing is allowed (breaking torches, doors, paintings, armor stands)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Red nickname - controlled griefer group, yellow - controlled cheater group&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;&amp;lt;&amp;lt; Back&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;---------------------------------------------&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;blockquote&gt;
&lt;p&gt;I guess &quot;No cheating!&quot; kinda counts as meta-gaming, even though it&#39;s pretty vague.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;What it means is that you&#39;re &lt;em&gt;really&lt;/em&gt; not supposed to use minimaps or any other
external tools to assist your gameplay. Yes, even JEI/EMI/etc fall under that.&lt;/p&gt;
&lt;p&gt;Anyways, after installing mod hider and adding JourneyMap (as well as some other
definitely allowed mods) to the hidden list and mapping a huge area, we get this:&lt;/p&gt;
&lt;img src=&quot;https://blog.kc.is.being.pet/processed_images/scrot_2026.09.22_15.51.18.1f979ef748258b6b.png&quot; alt=&quot;Screenshot of the web map I wrote a bit after&quot;&gt;
&lt;blockquote&gt;Screenshot of the web map I wrote a bit after&lt;/blockquote&gt;
&lt;p&gt;You could probably notice &lt;em&gt;a suspiciously circular area except it&#39;s not mapped out fully&lt;/em&gt;.
That was my attempt at stream-sniping the admin and mapping out his area.
The reason it&#39;s not fully mapped is that after this, he decided to inflict withering and slowness to
everyone inside that circle. Lame!&lt;/p&gt;
&lt;p&gt;I basically gave up playing on it after that, but there are some people that
still use my minimap and send me updated region screenshots!&lt;/p&gt;
&lt;p&gt;With latest update I also noticed new files alongside regular PNGs: &lt;code&gt;chunk_cache&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id=&quot;jmc&quot;&gt;&lt;code&gt;*.jmc&lt;/code&gt;&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;chunk_cache&lt;/code&gt; is per-dimension folder that contains chunk cache in JMs proprietary
file format. Chunk cache files are grouped into regions, the same way it works in
regular Minecraft.&lt;/p&gt;
&lt;p&gt;Unlike regular regions, &lt;code&gt;.jmc&lt;/code&gt; files don&#39;t store NBT data and seem to only care
about block data (with variants), as well as light levels. Basically, most of
things you&#39;d need to render a map from scratch.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;.jmc&lt;/code&gt; files (from now on I&#39;m gonna call them by their header magic: JMCA) are even structured the same way as regular region files: header
contains offsets and sizes of each chunks&#39; data. JMCA header also includes region position (which is absent in McRegion files), as well as a couple unused fields which
might see a light in the future (I sure hope not, I don&#39;t want to make any changes to my reader, especially with backwards compatibility).
Unlike McRegion, chunks in JMCA are &lt;em&gt;not&lt;/em&gt; &quot;page&quot;&lt;sup class=&quot;footnote-reference&quot;&gt;&lt;a href=&quot;#1&quot;&gt;1&lt;/a&gt;&lt;/sup&gt;-aligned, which saves a bit on space. JMCA also only supports zLib compression&lt;sup&gt;[citation needed]&lt;/sup&gt;&lt;/p&gt;
&lt;p&gt;In short, JMCA header can be represented as this C struct:&lt;/p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #CDD6F4; background-color: #1E1E2E;&quot; &gt;&lt;code data-lang=&quot;c&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #CBA6F7;&quot;&gt;struct&lt;/span&gt;&lt;span style=&quot;color: #89B4FA;font-style: italic;&quot;&gt; __attribute__&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;((&lt;/span&gt;&lt;span&gt;__packed__&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;))&lt;/span&gt;&lt;span&gt; JMCA_Header &lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;{&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #CBA6F7;&quot;&gt;    char&lt;/span&gt;&lt;span&gt; magic&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt;4&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;];&lt;/span&gt;&lt;span style=&quot;color: #9399B2;font-style: italic;&quot;&gt; // &amp;#39;J&amp;#39;, &amp;#39;M&amp;#39;, &amp;#39;C&amp;#39;, &amp;#39;A&amp;#39;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #CBA6F7;&quot;&gt;    uint8_t&lt;/span&gt;&lt;span&gt; unused1&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt;2&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;];&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #CBA6F7;&quot;&gt;    int16_t&lt;/span&gt;&lt;span&gt; region_x&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #CBA6F7;&quot;&gt;    int16_t&lt;/span&gt;&lt;span&gt; region_z&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #CBA6F7;&quot;&gt;    uint8_t&lt;/span&gt;&lt;span&gt; unused2&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt;6&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;];&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #CBA6F7;&quot;&gt;    int32_t&lt;/span&gt;&lt;span&gt; offsets&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt;32&lt;/span&gt;&lt;span style=&quot;color: #94E2D5;&quot;&gt; *&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt; 32&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;];&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #CBA6F7;&quot;&gt;    int32_t&lt;/span&gt;&lt;span&gt; lengths&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt;32&lt;/span&gt;&lt;span style=&quot;color: #94E2D5;&quot;&gt; *&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt; 32&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;];&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;};&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;All numbers are network(big)-endian.&lt;/p&gt;
&lt;p&gt;Chunks&#39; data can be accessed by &lt;code&gt;seek()&lt;/code&gt;ing to its &lt;code&gt;offsets[cx + cz * 32]&lt;/code&gt; and &lt;code&gt;read()&lt;/code&gt;ing &lt;code&gt;lengths[cx + cz * 32]&lt;/code&gt; bytes,
and then inflating it with zLib.&lt;/p&gt;
&lt;p&gt;Each chunk could be thought as a separate file with a separate magic and stuff.&lt;/p&gt;
&lt;h2 id=&quot;jmcs&quot;&gt;&lt;code&gt;JMCS&lt;/code&gt;&lt;/h2&gt;
&lt;p&gt;Each chunks&#39; data starts with &lt;code&gt;JMCS&lt;/code&gt; magic value, format and sections information,
followed by sections data. Again, structured similarly to McRegion chunks, except
chunks are not stored as NBT this time. In fact, I don&#39;t think there&#39;s any NBT
in &lt;code&gt;.jmc&lt;/code&gt; files at all!&lt;/p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #CDD6F4; background-color: #1E1E2E;&quot; &gt;&lt;code data-lang=&quot;c&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #CBA6F7;&quot;&gt;struct&lt;/span&gt;&lt;span style=&quot;color: #89B4FA;font-style: italic;&quot;&gt; __attribute__&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;((&lt;/span&gt;&lt;span&gt;__packed__&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;))&lt;/span&gt;&lt;span&gt; JMCS_Header &lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;{&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #CBA6F7;&quot;&gt;    char&lt;/span&gt;&lt;span&gt; magic&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt;4&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;];&lt;/span&gt;&lt;span style=&quot;color: #9399B2;font-style: italic;&quot;&gt; // &amp;#39;J&amp;#39;, &amp;#39;M&amp;#39;, &amp;#39;C&amp;#39;, &amp;#39;S&amp;#39;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #CBA6F7;&quot;&gt;    uint8_t&lt;/span&gt;&lt;span&gt; version&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;;&lt;/span&gt;&lt;span style=&quot;color: #9399B2;font-style: italic;&quot;&gt; // Only 3 and 4 are present at the moment of writing this&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #CBA6F7;&quot;&gt;    int32_t&lt;/span&gt;&lt;span&gt; min_section&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #CBA6F7;&quot;&gt;    int32_t&lt;/span&gt;&lt;span&gt; min_build_height&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #CBA6F7;&quot;&gt;    int32_t&lt;/span&gt;&lt;span&gt; max_build_height&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #CBA6F7;&quot;&gt;    uint8_t&lt;/span&gt;&lt;span&gt; section_count&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;;&lt;/span&gt;&lt;span style=&quot;color: #9399B2;font-style: italic;&quot;&gt; // No. of sections actually stored in the file&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;};&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Number of sections is derived from &lt;code&gt;*_build_height&lt;/code&gt;: &lt;code&gt;(max_build_height - min_build_height) &amp;gt;&amp;gt; 4&lt;/code&gt;.
Note that this is not &quot;how many sections are stored in the file&quot;, but how many sections
there &lt;em&gt;could&lt;/em&gt; be in each chunk. You should only read &lt;code&gt;section_count&lt;/code&gt; sections.
This value is used to reject sections that are outside of buildable range.&lt;/p&gt;
&lt;p&gt;Header is followed by sections data that can&#39;t be represented by a C struct, but I&#39;ll try anyways!&lt;/p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #CDD6F4; background-color: #1E1E2E;&quot; &gt;&lt;code data-lang=&quot;c&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #CBA6F7;&quot;&gt;struct&lt;/span&gt;&lt;span&gt; JMCS_Section &lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;{&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #CBA6F7;&quot;&gt;    uint8_t&lt;/span&gt;&lt;span&gt; section&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;;&lt;/span&gt;&lt;span style=&quot;color: #9399B2;font-style: italic;&quot;&gt; // Actual value is min_section + section&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #CBA6F7;&quot;&gt;    int32_t&lt;/span&gt;&lt;span&gt; palette_size&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #CBA6F7;&quot;&gt;    struct&lt;/span&gt;&lt;span&gt; JMCS_Palette_Entry &lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;{&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        UTF_String name&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #CBA6F7;&quot;&gt;        uint8_t&lt;/span&gt;&lt;span&gt; n_properties&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #CBA6F7;&quot;&gt;        struct&lt;/span&gt;&lt;span&gt; JMCS_Palette_Property &lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;{&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            UTF_String key&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            UTF_String value&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;        }&lt;/span&gt;&lt;span&gt; properties&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;[&lt;/span&gt;&lt;span&gt;n_properties&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;];&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;    }&lt;/span&gt;&lt;span&gt; palette&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;[&lt;/span&gt;&lt;span&gt;palette_size&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;];&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #CBA6F7;&quot;&gt;    uint16_t&lt;/span&gt;&lt;span&gt; indices&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt;16&lt;/span&gt;&lt;span style=&quot;color: #94E2D5;&quot;&gt; *&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt; 16&lt;/span&gt;&lt;span style=&quot;color: #94E2D5;&quot;&gt; *&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt; 16&lt;/span&gt;&lt;span style=&quot;color: #94E2D5;&quot;&gt; *&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt; 2&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;];&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;};&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;code&gt;UTF_String&lt;/code&gt; is that weird aah format that Java uses: &lt;code&gt;unt16_t&lt;/code&gt; length followed by &lt;a rel=&quot;noopener nofollow noreferrer external&quot; target=&quot;_blank&quot; href=&quot;https://docs.oracle.com/javase/8/docs/api/java/io/DataInput.html#modified-utf-8&quot;&gt;&quot;modified UTF-8&quot;&lt;/a&gt; string.&lt;/p&gt;
&lt;blockquote class=&quot;markdown-alert-warning&quot;&gt;
&lt;p&gt;Reader &lt;strong&gt;MUST&lt;/strong&gt; read section data even if &lt;code&gt;section&lt;/code&gt; value is outside of buildable range.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2 id=&quot;todo-finish-this&quot;&gt;// TODO: finish this&lt;/h2&gt;
&lt;h2 id=&quot;footnotes&quot;&gt;Footnotes&lt;/h2&gt;
&lt;div class=&quot;footnote-definition&quot; id=&quot;1&quot;&gt;&lt;sup class=&quot;footnote-definition-label&quot;&gt;1&lt;/sup&gt;
&lt;p&gt;Chunk data in McRegion &lt;code&gt;.mca&lt;/code&gt; files is aligned to 4kiB pages for some reason.
Each chunk can also only have 255 pages, so compressed chunk size is limited to just under 1MiB&lt;sup class=&quot;footnote-reference&quot;&gt;&lt;a href=&quot;#2&quot;&gt;2&lt;/a&gt;&lt;/sup&gt;, which is REALLY not a lot for Minecraft (especially modded one).
I&#39;ve personally ran into that problem on my modded Minecraft server that had a bunch of items in SophisticatedStorage chests, which caused light data to not save.
I had to move everything to SophisticatedBackpacks, since they only store storage UUIDs and not items themselves.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;footnote-definition&quot; id=&quot;2&quot;&gt;&lt;sup class=&quot;footnote-definition-label&quot;&gt;2&lt;/sup&gt;
&lt;p&gt;APPARENTLY it&#39;s not supposed to do that! It should instead write chunk data to &lt;code&gt;.mcc&lt;/code&gt; files instead of storing them in the region itself.
Source: &lt;a rel=&quot;noopener nofollow noreferrer external&quot; target=&quot;_blank&quot; href=&quot;https://minecraft.wiki/w/Region_file_format#Payload&quot;&gt;Minecraft Wiki: Region file format&lt;/a&gt;&lt;/p&gt;
&lt;/div&gt;
</description>
      </item>
      <item>
          <title>Playing with the CYD</title>
          <pubDate>Thu, 17 Sep 2026 12:56:00 +0000</pubDate>
          <author>Casey</author>
          <link>https://blog.kc.is.being.pet/posts/playing-with-the-cyd/</link>
          <guid>https://blog.kc.is.being.pet/posts/playing-with-the-cyd/</guid>
          <description xml:base="https://blog.kc.is.being.pet/posts/playing-with-the-cyd/">&lt;p&gt;A couple weeks ago I bought myself a tiny little yellow ESP32 board with a touchscreen on it, commonly known as &quot;Cheap Yellow Display&quot; (aka CYD).
It&#39;s a pretty capable board with &lt;code&gt;ESP32-D0WD-V3&lt;/code&gt; MCU on it as well as some useful peripherals (such as microSD card slot, DAC with an amplifier and afformentioned touchscreen).&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;At the moment of writing this post I&#39;ve done way too many things without taking many photos, so this post is gonna look pretty lame 😔&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2 id=&quot;short-board-info&quot;&gt;Short board info&lt;/h2&gt;
&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;thang&lt;/th&gt;&lt;th&gt;description&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;RAM&lt;/td&gt;&lt;td&gt;520KB&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Flash&lt;/td&gt;&lt;td&gt;4MB QSPI&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Display&lt;/td&gt;&lt;td&gt;&lt;code&gt;ILI9341&lt;/code&gt; &lt;sup class=&quot;footnote-reference&quot;&gt;&lt;a href=&quot;#1&quot;&gt;1&lt;/a&gt;&lt;/sup&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Touchscreen&lt;/td&gt;&lt;td&gt;resistive with &lt;code&gt;XPT2046&lt;/code&gt; controller&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;UART driver&lt;/td&gt;&lt;td&gt;&lt;code&gt;CH340&lt;/code&gt; as always&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Price&lt;/td&gt;&lt;td&gt;~$12&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div class=&quot;footnote-definition&quot; id=&quot;1&quot;&gt;&lt;sup class=&quot;footnote-definition-label&quot;&gt;1&lt;/sup&gt;
&lt;p&gt;Unfortunately it only works at 40MHz or lower, 80MHz makes it freak out too much (image below)&lt;/p&gt;
&lt;/div&gt;
&lt;img src=&quot;https://blog.kc.is.being.pet/processed_images/P1230539.a5a790fe9fa7abeb.jpg&quot; alt=&quot;Screen at 80MHz&quot;&gt;
&lt;blockquote&gt;Screen at 80MHz&lt;/blockquote&gt;
&lt;p&gt;It also has on-board RGB LED on pins 4, 16 and 17 (not addressable one, unfortunately) but I ended up using those pins for a different purpose :3&lt;/p&gt;
&lt;p&gt;A &lt;em&gt;ton&lt;/em&gt; of helpful information I got from &lt;a rel=&quot;noopener nofollow noreferrer external&quot; target=&quot;_blank&quot; href=&quot;https://mischianti.org/esp32-2432s028-cheap-yellow-display-high-resolution-pinout-datasheet-schema-and-specs/&quot;&gt;this&lt;/a&gt; page, including some mentioned here&lt;/p&gt;
&lt;h2 id=&quot;i-can-see-now&quot;&gt;i can see now&lt;/h2&gt;
&lt;p&gt;First thing I did with it is flashed &lt;a rel=&quot;noopener nofollow noreferrer external&quot; target=&quot;_blank&quot; href=&quot;https://micropython.org/&quot;&gt;MicroPython&lt;/a&gt; and tried to get display running&lt;/p&gt;
&lt;p&gt;After &lt;del&gt;very long sesh&lt;/del&gt; looking into &lt;a rel=&quot;noopener nofollow noreferrer external&quot; target=&quot;_blank&quot; href=&quot;https://github.com/PaulStoffregen/ILI9341_t3/&quot;&gt;how others have done it in Arduino land&lt;/a&gt;, i just ended up sending minimal init sequence to that display:&lt;/p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #CDD6F4; background-color: #1E1E2E;&quot; &gt;&lt;code data-lang=&quot;python&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;_INIT_SEQUENCE&lt;/span&gt;&lt;span style=&quot;color: #94E2D5;&quot;&gt; =&lt;/span&gt;&lt;span&gt; micropython&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #89B4FA;&quot;&gt;const&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;((&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;    (&lt;/span&gt;&lt;span style=&quot;color: #CBA6F7;&quot;&gt;0x&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt;01&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt; None&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;),&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;    (&lt;/span&gt;&lt;span style=&quot;color: #CBA6F7;&quot;&gt;0x&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt;cf&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;font-style: italic;&quot;&gt; b&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #F5C2E7;&quot;&gt;\x00\xc1\x30&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;),&lt;/span&gt;&lt;span style=&quot;color: #9399B2;font-style: italic;&quot;&gt; # PWCTRB&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;    (&lt;/span&gt;&lt;span style=&quot;color: #CBA6F7;&quot;&gt;0x&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt;ed&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;font-style: italic;&quot;&gt; b&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #F5C2E7;&quot;&gt;\x64\x03\x12\x81&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;),&lt;/span&gt;&lt;span style=&quot;color: #9399B2;font-style: italic;&quot;&gt; # POSC&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;    (&lt;/span&gt;&lt;span style=&quot;color: #CBA6F7;&quot;&gt;0x&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt;e8&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;font-style: italic;&quot;&gt; b&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #F5C2E7;&quot;&gt;\x85\x00\x78&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;),&lt;/span&gt;&lt;span style=&quot;color: #9399B2;font-style: italic;&quot;&gt; # DTCA&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;    (&lt;/span&gt;&lt;span style=&quot;color: #CBA6F7;&quot;&gt;0x&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt;cb&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;font-style: italic;&quot;&gt; b&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #F5C2E7;&quot;&gt;\x39\x2c\x00\x34\x02&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;),&lt;/span&gt;&lt;span style=&quot;color: #9399B2;font-style: italic;&quot;&gt; # PWCTRA&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;    (&lt;/span&gt;&lt;span style=&quot;color: #CBA6F7;&quot;&gt;0x&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt;f7&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;font-style: italic;&quot;&gt; b&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #F5C2E7;&quot;&gt;\x20&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;),&lt;/span&gt;&lt;span style=&quot;color: #9399B2;font-style: italic;&quot;&gt; # PUMPRC&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;    (&lt;/span&gt;&lt;span style=&quot;color: #CBA6F7;&quot;&gt;0x&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt;ea&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;font-style: italic;&quot;&gt; b&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #F5C2E7;&quot;&gt;\x00\x00&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;),&lt;/span&gt;&lt;span style=&quot;color: #9399B2;font-style: italic;&quot;&gt; # DTCB&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;    (&lt;/span&gt;&lt;span style=&quot;color: #CBA6F7;&quot;&gt;0x&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt;c0&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;font-style: italic;&quot;&gt; b&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #F5C2E7;&quot;&gt;\x23&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;),&lt;/span&gt;&lt;span style=&quot;color: #9399B2;font-style: italic;&quot;&gt; # PWCTR1&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;    (&lt;/span&gt;&lt;span style=&quot;color: #CBA6F7;&quot;&gt;0x&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt;c1&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;font-style: italic;&quot;&gt; b&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #F5C2E7;&quot;&gt;\x10&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;),&lt;/span&gt;&lt;span style=&quot;color: #9399B2;font-style: italic;&quot;&gt; # PWCTR2&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;    (&lt;/span&gt;&lt;span style=&quot;color: #CBA6F7;&quot;&gt;0x&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt;c5&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;font-style: italic;&quot;&gt; b&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #F5C2E7;&quot;&gt;\x3e\x28&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;),&lt;/span&gt;&lt;span style=&quot;color: #9399B2;font-style: italic;&quot;&gt; # VMCTR1&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;    (&lt;/span&gt;&lt;span style=&quot;color: #CBA6F7;&quot;&gt;0x&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt;c7&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;font-style: italic;&quot;&gt; b&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #F5C2E7;&quot;&gt;\xB3&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;),&lt;/span&gt;&lt;span style=&quot;color: #9399B2;font-style: italic;&quot;&gt; # VMCTR2&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9399B2;font-style: italic;&quot;&gt;    #        ^^^^&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9399B2;font-style: italic;&quot;&gt;    # EVIL FUCKING THING THAT&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9399B2;font-style: italic;&quot;&gt;    # WAS 0x86 BEFORE AND LOOKED&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9399B2;font-style: italic;&quot;&gt;    # LIKE ABSOLUTE GARBAGE&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;    (&lt;/span&gt;&lt;span style=&quot;color: #CBA6F7;&quot;&gt;0x&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt;36&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;font-style: italic;&quot;&gt; b&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #F5C2E7;&quot;&gt;\x20&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;),&lt;/span&gt;&lt;span style=&quot;color: #9399B2;font-style: italic;&quot;&gt; # MADCTL: Rotation&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;    (&lt;/span&gt;&lt;span style=&quot;color: #CBA6F7;&quot;&gt;0x&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt;37&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;font-style: italic;&quot;&gt; b&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #F5C2E7;&quot;&gt;\x00&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;),&lt;/span&gt;&lt;span style=&quot;color: #9399B2;font-style: italic;&quot;&gt; # VSCRSADD&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;    (&lt;/span&gt;&lt;span style=&quot;color: #CBA6F7;&quot;&gt;0x&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt;3a&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;font-style: italic;&quot;&gt; b&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #F5C2E7;&quot;&gt;\x55&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;),&lt;/span&gt;&lt;span style=&quot;color: #9399B2;font-style: italic;&quot;&gt; # PIXFMT&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;    (&lt;/span&gt;&lt;span style=&quot;color: #CBA6F7;&quot;&gt;0x&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt;b1&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;font-style: italic;&quot;&gt; b&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #F5C2E7;&quot;&gt;\x00\x18&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;),&lt;/span&gt;&lt;span style=&quot;color: #9399B2;font-style: italic;&quot;&gt; # FRMCTR1&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;    (&lt;/span&gt;&lt;span style=&quot;color: #CBA6F7;&quot;&gt;0x&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt;b6&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;font-style: italic;&quot;&gt; b&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #F5C2E7;&quot;&gt;\x08\x82\x27&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;),&lt;/span&gt;&lt;span style=&quot;color: #9399B2;font-style: italic;&quot;&gt; # DFUNCTR&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;    (&lt;/span&gt;&lt;span style=&quot;color: #CBA6F7;&quot;&gt;0x&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt;f2&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;font-style: italic;&quot;&gt; b&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #F5C2E7;&quot;&gt;\x00&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;),&lt;/span&gt;&lt;span style=&quot;color: #9399B2;font-style: italic;&quot;&gt; # ENABLE3G&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;    (&lt;/span&gt;&lt;span style=&quot;color: #CBA6F7;&quot;&gt;0x&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt;26&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;font-style: italic;&quot;&gt; b&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #F5C2E7;&quot;&gt;\x01&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;),&lt;/span&gt;&lt;span style=&quot;color: #9399B2;font-style: italic;&quot;&gt; # GAMMASET&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;    (&lt;/span&gt;&lt;span style=&quot;color: #CBA6F7;&quot;&gt;0x&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt;e0&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;font-style: italic;&quot;&gt; b&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #F5C2E7;&quot;&gt;\x0f\x31\x2b\x0c\x0e\x08\x4e\xf1\x37\x07\x10\x03\x0e\x09\x00&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;),&lt;/span&gt;&lt;span style=&quot;color: #9399B2;font-style: italic;&quot;&gt; # GMCTRP1&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;    (&lt;/span&gt;&lt;span style=&quot;color: #CBA6F7;&quot;&gt;0x&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt;e1&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;font-style: italic;&quot;&gt; b&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #F5C2E7;&quot;&gt;\x00\x0e\x14\x03\x11\x07\x31\xc1\x48\x08\x0f\x0c\x31\x36\x0f&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;),&lt;/span&gt;&lt;span style=&quot;color: #9399B2;font-style: italic;&quot;&gt; # GMCTRN1&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9399B2;font-style: italic;&quot;&gt;    # Imma be honest, I have no idea what those values mean ^&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;    (&lt;/span&gt;&lt;span style=&quot;color: #CBA6F7;&quot;&gt;0x&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt;11&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt; None&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;),&lt;/span&gt;&lt;span style=&quot;color: #9399B2;font-style: italic;&quot;&gt; # SLPOUT&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;    (&lt;/span&gt;&lt;span style=&quot;color: #CBA6F7;&quot;&gt;0x&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt;29&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt; None&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;),&lt;/span&gt;&lt;span style=&quot;color: #9399B2;font-style: italic;&quot;&gt; # DISPLAY_ON&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;))&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;after which sending frames was as easy as setting window for changes:&lt;/p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #CDD6F4; background-color: #1E1E2E;&quot; &gt;&lt;code data-lang=&quot;python&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #89B4FA;&quot;&gt;cmd_with_data&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #CBA6F7;&quot;&gt;0x&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt;2A&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;,&lt;/span&gt;&lt;span&gt; struct&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #89B4FA;&quot;&gt;pack&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;&amp;quot;&amp;gt;HH&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;,&lt;/span&gt;&lt;span&gt; x&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;,&lt;/span&gt;&lt;span&gt; x&lt;/span&gt;&lt;span style=&quot;color: #94E2D5;&quot;&gt; +&lt;/span&gt;&lt;span&gt; w&lt;/span&gt;&lt;span style=&quot;color: #94E2D5;&quot;&gt; -&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt; 1&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;))&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #89B4FA;&quot;&gt;cmd_with_data&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #CBA6F7;&quot;&gt;0x&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt;2B&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;,&lt;/span&gt;&lt;span&gt; struct&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #89B4FA;&quot;&gt;pack&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;&amp;quot;&amp;gt;HH&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;,&lt;/span&gt;&lt;span&gt; y&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;,&lt;/span&gt;&lt;span&gt; y&lt;/span&gt;&lt;span style=&quot;color: #94E2D5;&quot;&gt; +&lt;/span&gt;&lt;span&gt; h&lt;/span&gt;&lt;span style=&quot;color: #94E2D5;&quot;&gt; -&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt; 1&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;))&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #89B4FA;&quot;&gt;cmd&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #CBA6F7;&quot;&gt;0x&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt;2C&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #9399B2;font-style: italic;&quot;&gt; # RAMWR&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;and just writing image buffer as is-&lt;/p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #CDD6F4; background-color: #1E1E2E;&quot; &gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Traceback (most recent call last):&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  File &amp;quot;&amp;lt;stdin&amp;gt;&amp;quot;, line 1, in &amp;lt;module&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;MemoryError: memory allocation failed, allocating 153600 bytes&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;...rrrright....&lt;/p&gt;
&lt;p&gt;Luckily for me I have spent enough time on making &lt;a rel=&quot;noopener nofollow noreferrer external&quot; target=&quot;_blank&quot; href=&quot;https://git.being.pet/hkc/mpy-mod-ccterm&quot;&gt;ComputerCraft Term API-compatible renderer for MicroPython&lt;/a&gt; which lets me update lines at a time (just 5724 bytes of pixels) instead of whole screen at once&lt;/p&gt;
&lt;p&gt;After some refactoring and cleanup, all we have to do to get a working terminal is:&lt;/p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #CDD6F4; background-color: #1E1E2E;&quot; &gt;&lt;code data-lang=&quot;python&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #CBA6F7;&quot;&gt;from&lt;/span&gt;&lt;span&gt; ccterm&lt;/span&gt;&lt;span style=&quot;color: #CBA6F7;&quot;&gt; import&lt;/span&gt;&lt;span&gt; CCTerm&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #CBA6F7;&quot;&gt;from&lt;/span&gt;&lt;span&gt; machine&lt;/span&gt;&lt;span style=&quot;color: #CBA6F7;&quot;&gt; import&lt;/span&gt;&lt;span&gt; Pin&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;,&lt;/span&gt;&lt;span&gt; SPI&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #CBA6F7;&quot;&gt;from&lt;/span&gt;&lt;span&gt; lcd&lt;/span&gt;&lt;span style=&quot;color: #CBA6F7;&quot;&gt; import&lt;/span&gt;&lt;span&gt; LCD&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;spi_lcd&lt;/span&gt;&lt;span style=&quot;color: #94E2D5;&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color: #89B4FA;&quot;&gt; SPI&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt; 40000000&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #EBA0AC;font-style: italic;&quot;&gt; mosi&lt;/span&gt;&lt;span style=&quot;color: #94E2D5;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt;13&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #EBA0AC;font-style: italic;&quot;&gt; miso&lt;/span&gt;&lt;span style=&quot;color: #94E2D5;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt;12&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #EBA0AC;font-style: italic;&quot;&gt; sck&lt;/span&gt;&lt;span style=&quot;color: #94E2D5;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt;14&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;lcd&lt;/span&gt;&lt;span style=&quot;color: #94E2D5;&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color: #89B4FA;&quot;&gt; LCD&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;(&lt;/span&gt;&lt;span&gt;spi_lcd&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #89B4FA;&quot;&gt; Pin&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt;2&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;,&lt;/span&gt;&lt;span&gt; Pin&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;.&lt;/span&gt;&lt;span&gt;OUT&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;),&lt;/span&gt;&lt;span style=&quot;color: #89B4FA;&quot;&gt; Pin&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt;15&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;,&lt;/span&gt;&lt;span&gt; Pin&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;.&lt;/span&gt;&lt;span&gt;OUT&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;))&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;backlight&lt;/span&gt;&lt;span style=&quot;color: #94E2D5;&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color: #89B4FA;&quot;&gt; Pin&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt;21&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;,&lt;/span&gt;&lt;span&gt; Pin&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;.&lt;/span&gt;&lt;span&gt;OUT&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #EBA0AC;font-style: italic;&quot;&gt; value&lt;/span&gt;&lt;span style=&quot;color: #94E2D5;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;term_buf&lt;/span&gt;&lt;span style=&quot;color: #94E2D5;&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color: #CBA6F7;font-style: italic;&quot;&gt; bytearray&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt;53&lt;/span&gt;&lt;span style=&quot;color: #94E2D5;&quot;&gt; *&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt; 26&lt;/span&gt;&lt;span style=&quot;color: #94E2D5;&quot;&gt; *&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt; 2&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;line_buf&lt;/span&gt;&lt;span style=&quot;color: #94E2D5;&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color: #CBA6F7;font-style: italic;&quot;&gt; bytearray&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt;53&lt;/span&gt;&lt;span style=&quot;color: #94E2D5;&quot;&gt; *&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt; 6&lt;/span&gt;&lt;span style=&quot;color: #94E2D5;&quot;&gt; *&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt; 9&lt;/span&gt;&lt;span style=&quot;color: #94E2D5;&quot;&gt; *&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt; 2&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;term&lt;/span&gt;&lt;span style=&quot;color: #94E2D5;&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color: #89B4FA;&quot;&gt; CCTerm&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;(&lt;/span&gt;&lt;span&gt;term_buf&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt; 53&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt; 26&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #CBA6F7;&quot;&gt;def&lt;/span&gt;&lt;span style=&quot;color: #89B4FA;font-style: italic;&quot;&gt; refresh_screen&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;():&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    lcd&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #89B4FA;&quot;&gt;set_window&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt; 3&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt; 318&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt; 234&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #9399B2;font-style: italic;&quot;&gt; # centers it out&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #CBA6F7;&quot;&gt;    for&lt;/span&gt;&lt;span&gt; y&lt;/span&gt;&lt;span style=&quot;color: #CBA6F7;&quot;&gt; in&lt;/span&gt;&lt;span style=&quot;color: #FAB387;font-style: italic;&quot;&gt; range&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt;26&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;):&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        term&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #89B4FA;&quot;&gt;get_line_pixel_data&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;(&lt;/span&gt;&lt;span&gt;y&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;,&lt;/span&gt;&lt;span&gt; line_buf&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        lcd&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #89B4FA;&quot;&gt;data&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;(&lt;/span&gt;&lt;span&gt;line_buf&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;term&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #89B4FA;&quot;&gt;set_background_color&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #94E2D5;&quot;&gt; &amp;lt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt; 15&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #9399B2;font-style: italic;&quot;&gt; # black&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;term&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #89B4FA;&quot;&gt;set_text_color&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #9399B2;font-style: italic;&quot;&gt; # white&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;term&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #89B4FA;&quot;&gt;clear&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;()&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;term&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #89B4FA;&quot;&gt;puts&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;&amp;quot;Hello, &amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;term&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #89B4FA;&quot;&gt;set_text_color&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #94E2D5;&quot;&gt; &amp;lt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt; 3&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;term&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #89B4FA;&quot;&gt;puts&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;&amp;quot;MicroPython!&lt;/span&gt;&lt;span style=&quot;color: #F5C2E7;&quot;&gt;\n&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #89B4FA;&quot;&gt;refresh_screen&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;()&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;blockquote class=&quot;markdown-alert-tip&quot;&gt;
&lt;p&gt;Source of everything can be found &lt;a rel=&quot;noopener nofollow noreferrer external&quot; target=&quot;_blank&quot; href=&quot;https://git.being.pet/hkc/cyd-shenanigans&quot;&gt;here&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Which gives us this:&lt;/p&gt;
&lt;img src=&quot;https://blog.kc.is.being.pet/processed_images/cyd-hello-micropython.d92442b10b93d5fc.jpg&quot; alt=&quot;Excuse poor image quality, I was taking those photos at work&quot;&gt;
&lt;blockquote&gt;Excuse poor image quality, I was taking those photos at work&lt;/blockquote&gt;
&lt;p&gt;Now it would be nice to have a..&lt;/p&gt;
&lt;h2 id=&quot;way-to-input-stuff&quot;&gt;way to input stuff&lt;/h2&gt;
&lt;p&gt;A bit before getting this board I also bought &lt;a rel=&quot;noopener nofollow noreferrer external&quot; target=&quot;_blank&quot; href=&quot;https://docs.m5stack.com/en/unit/cardkb_1.1&quot;&gt;CardKB from M5Stack&lt;/a&gt;.
It&#39;s a tiny keyboard with 50 keys, I&lt;sup&gt;2&lt;/sup&gt;C interface and a status LED, powered by ATMega8A chip.
Annoyingly, it costed more than CYD, but not by much&lt;/p&gt;
&lt;p&gt;Using it is was &lt;em&gt;so&lt;/em&gt; much easier than poking that display: just read a byte from 0x5F and that&#39;s it, the key!
Keycodes pretty much follow ASCII for alphanumeric symbols, ESC is sent as familiar &lt;code&gt;0x1B&lt;/code&gt; and Return key is CR and not LF for some reason.
&lt;code&gt;fn+[K]&lt;/code&gt; keycodes are a bit weird, but nothing too difficult to work with. I ended up using them as an alternative to &lt;code&gt;Ctrl+[K]&lt;/code&gt; presses in the end.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;A couple really annoying things with that keyboard: it tends to reset if you touch second pin of ISP section and using those keys for prolonged periods of time hurts my fingers &lt;strong&gt;a ton&lt;/strong&gt;. I might end up printing keycaps for those to make my life a bit easier&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;As previously mentioned, &lt;code&gt;Fn&lt;/code&gt;-keycodes are slightly weird, so I made a mapping of some of them to more common sequences (that MicroPython also understands):&lt;/p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #CDD6F4; background-color: #1E1E2E;&quot; &gt;&lt;code data-lang=&quot;python&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;char_mapping&lt;/span&gt;&lt;span style=&quot;color: #94E2D5;&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #CBA6F7;&quot;&gt;    0x&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt;08&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;font-style: italic;&quot;&gt; b&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #F5C2E7;&quot;&gt;\x08&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #9399B2;font-style: italic;&quot;&gt; # BS&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #CBA6F7;&quot;&gt;    0x&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt;09&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;font-style: italic;&quot;&gt; b&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #F5C2E7;&quot;&gt;\x09&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #9399B2;font-style: italic;&quot;&gt; # HT,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #CBA6F7;&quot;&gt;    0x&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt;0D&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;font-style: italic;&quot;&gt; b&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #F5C2E7;&quot;&gt;\x0D&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #9399B2;font-style: italic;&quot;&gt; # CR&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #CBA6F7;&quot;&gt;    0x&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt;9A&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;font-style: italic;&quot;&gt; b&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #F5C2E7;&quot;&gt;\x01&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #9399B2;font-style: italic;&quot;&gt; # Fn+A -&amp;gt; Ctrl+A (goto beginning)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #CBA6F7;&quot;&gt;    0x&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt;A8&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;font-style: italic;&quot;&gt; b&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #F5C2E7;&quot;&gt;\x03&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #9399B2;font-style: italic;&quot;&gt; # Fn+C -&amp;gt; Ctrl+C (keyboard interrupt)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #CBA6F7;&quot;&gt;    0x&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt;9C&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;font-style: italic;&quot;&gt; b&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #F5C2E7;&quot;&gt;\x04&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #9399B2;font-style: italic;&quot;&gt; # Fn+D -&amp;gt; Ctrl+D (eof)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #CBA6F7;&quot;&gt;    0x&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt;8F&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;font-style: italic;&quot;&gt; b&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #F5C2E7;&quot;&gt;\x05&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #9399B2;font-style: italic;&quot;&gt; # Fn+E -&amp;gt; Ctrl+E (goto end)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #CBA6F7;&quot;&gt;    0x&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt;B5&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;font-style: italic;&quot;&gt; b&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #F5C2E7;&quot;&gt;\x1b&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;[A&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #9399B2;font-style: italic;&quot;&gt; # Up&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #CBA6F7;&quot;&gt;    0x&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt;B6&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;font-style: italic;&quot;&gt; b&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #F5C2E7;&quot;&gt;\x1b&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;[B&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #9399B2;font-style: italic;&quot;&gt; # Down&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #CBA6F7;&quot;&gt;    0x&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt;B4&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;font-style: italic;&quot;&gt; b&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #F5C2E7;&quot;&gt;\x1b&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;[D&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #9399B2;font-style: italic;&quot;&gt; # Left&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #CBA6F7;&quot;&gt;    0x&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt;B7&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;font-style: italic;&quot;&gt; b&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #F5C2E7;&quot;&gt;\x1b&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;[C&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #9399B2;font-style: italic;&quot;&gt; # Right&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #CBA6F7;&quot;&gt;    0x&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt;98&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;font-style: italic;&quot;&gt; b&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #F5C2E7;&quot;&gt;\x1b&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;[H&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #9399B2;font-style: italic;&quot;&gt; # Home&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #CBA6F7;&quot;&gt;    0x&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt;a5&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;font-style: italic;&quot;&gt; b&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #F5C2E7;&quot;&gt;\x1b&lt;/span&gt;&lt;span style=&quot;color: #A6E3A1;&quot;&gt;[4~&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #9399B2;font-style: italic;&quot;&gt; # End&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #CBA6F7;&quot;&gt;    0x&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt;8b&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;: [&lt;/span&gt;&lt;span style=&quot;color: #CBA6F7;&quot;&gt;0x&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt;0B&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;],&lt;/span&gt;&lt;span style=&quot;color: #9399B2;font-style: italic;&quot;&gt; # Fn+BS -&amp;gt; Del&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Oh also! Since we need I&lt;sup&gt;2&lt;/sup&gt;C bus, I ended up using &lt;em&gt;conveniently-shaped-4-pin-header-that-also-happens-to-have-power-wired-into-it&lt;/em&gt;.
I cut off half the cable keyboard came with, soldered it to the one that CYD had and added 4 connectors in case I&#39;d want to connect something else to the same bus. It looks ugly and I don&#39;t wanna show it&lt;/p&gt;
&lt;p&gt;Now if we just...&lt;/p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #CDD6F4; background-color: #1E1E2E;&quot; &gt;&lt;code data-lang=&quot;python&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #CBA6F7;&quot;&gt;from&lt;/span&gt;&lt;span&gt; machine&lt;/span&gt;&lt;span style=&quot;color: #CBA6F7;&quot;&gt; import&lt;/span&gt;&lt;span&gt; I2C&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;iic&lt;/span&gt;&lt;span style=&quot;color: #94E2D5;&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color: #89B4FA;&quot;&gt; I2C&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #EBA0AC;font-style: italic;&quot;&gt;scl&lt;/span&gt;&lt;span style=&quot;color: #94E2D5;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #89B4FA;&quot;&gt;Pin&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt;22&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;),&lt;/span&gt;&lt;span style=&quot;color: #EBA0AC;font-style: italic;&quot;&gt; sda&lt;/span&gt;&lt;span style=&quot;color: #94E2D5;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #89B4FA;&quot;&gt;Pin&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt;27&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;))&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9399B2;font-style: italic;&quot;&gt;# ...&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9399B2;font-style: italic;&quot;&gt;#&lt;/span&gt;&lt;span style=&quot;color: #CBA6F7;&quot;&gt; NOTE&lt;/span&gt;&lt;span style=&quot;color: #9399B2;font-style: italic;&quot;&gt;: for the time being I&amp;#39;m using only this&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9399B2;font-style: italic;&quot;&gt;# as it&amp;#39;s too early to use full ESC/CSI sequences here&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;char_mapping&lt;/span&gt;&lt;span style=&quot;color: #94E2D5;&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #CBA6F7;&quot;&gt;    0x&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt;0D&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #CBA6F7;&quot;&gt; 0x&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt;0A&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #CBA6F7;&quot;&gt;while&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt; True&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #CBA6F7;&quot;&gt;    try&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        kc&lt;/span&gt;&lt;span style=&quot;color: #94E2D5;&quot;&gt; =&lt;/span&gt;&lt;span&gt; iic&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #89B4FA;&quot;&gt;readfrom&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #CBA6F7;&quot;&gt;0x&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt;5F&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt; 1&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;)[&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #CBA6F7;&quot;&gt;        if&lt;/span&gt;&lt;span&gt; kc&lt;/span&gt;&lt;span style=&quot;color: #94E2D5;&quot;&gt; !=&lt;/span&gt;&lt;span style=&quot;color: #CBA6F7;&quot;&gt; 0x&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt;00&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            term&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #89B4FA;&quot;&gt;putc&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;(&lt;/span&gt;&lt;span&gt;char_mapping&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #89B4FA;&quot;&gt;get&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;(&lt;/span&gt;&lt;span&gt;kc&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;,&lt;/span&gt;&lt;span&gt; kc&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;))&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #CBA6F7;&quot;&gt;    except&lt;/span&gt;&lt;span style=&quot;color: #FAB387;font-style: italic;&quot;&gt; Exception&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #CBA6F7;&quot;&gt;        pass&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #89B4FA;&quot;&gt;    refresh_screen&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;()&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    time&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #89B4FA;&quot;&gt;sleep_ms&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #FAB387;&quot;&gt;50&lt;/span&gt;&lt;span style=&quot;color: #9399B2;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;And now we can type stuff on the screen, yay!&lt;/p&gt;
&lt;p&gt;Sometime later I&#39;m gonna talk about how I made this monsterosity work as self-contained MicroPython REPL, made it feel touches and scream on boot&lt;/p&gt;
&lt;p&gt;That&#39;s it for now, I wanna piss and don&#39;t feel like writing anymore, baiii&lt;/p&gt;
</description>
      </item>
      <item>
          <title>First page</title>
          <pubDate>Thu, 17 Sep 2026 10:50:00 +0000</pubDate>
          <author>Casey</author>
          <link>https://blog.kc.is.being.pet/posts/hello/</link>
          <guid>https://blog.kc.is.being.pet/posts/hello/</guid>
          <description xml:base="https://blog.kc.is.being.pet/posts/hello/">&lt;h1 id=&quot;hello-world&quot;&gt;Hello, world!&lt;/h1&gt;
&lt;p&gt;More coming soon hopefully&lt;/p&gt;
</description>
      </item>
    </channel>
</rss>
