This commit is contained in:
Bottersnike 2022-05-19 01:50:12 +01:00
parent 15f69f6257
commit c8abfccb69
4 changed files with 165 additions and 3 deletions

View File

@ -44,6 +44,7 @@ SEGA_CONTENTS = {
"hardware": ("Hardware", ()),
"software": ("Software", {
"jvs.html": "JVS",
"touch.html": "Touchscreen",
"drivers": ("Device drivers",
#{
# "columba.html": "columba",
@ -81,13 +82,14 @@ class Part:
PARTS = {
"838-14971": Part("838-14971", "Aime NFC daughter board", "NFC RW BD TN32MSEC003S")
"838-14971": Part("838-14971", "Aime NFC daughter board", "NFC RW BD TN32MSEC003S"),
"838-15221": Part("838-15221", "Serial I/F BD Touchpanel Gunze", "The interface board for the touchscreen on MaiMai versions pre-DX.")
}
def part(id):
if (part := PARTS.get(id)):
return f'<span class="part" tabindex="0">{part.name}<span><span>Part number</span><span>{part.id}</span><span>Description</span><span>{part.description}</span></span></span>'
return f'<span class="part" tabindex="0">{part.name}<span><span>ASSY ID</span><span>SEGA {part.id}</span><span>Description</span><span>{part.description}</span></span></span>'
return f'<span class="part">{id}</span>'

View File

@ -180,6 +180,7 @@ footer>*:last-child {
position: relative;
display: inline;
cursor: help;
background-color: #fff;
}
.part span {
@ -240,6 +241,9 @@ mark {
code {
background-color: #221115;
}
.part {
background-color: #000;
}
.highlight, img:not(.graphic) {
filter: invert(1);

View File

@ -7,7 +7,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{% block title %}{% endblock %}{% if self.title() %} | {% endif %}{% block roottitle %}Arcade Reverse Engineering{% endblock %}</title>
<link rel="stylesheet" href="{{ROOT}}/styles.css?ver=9">
<link rel="stylesheet" href="{{ROOT}}/styles.css?ver=10">
<link rel="stylesheet" href="{{ROOT}}/tango.css">
<script async src="https://www.googletagmanager.com/gtag/js?id=G-LG6C6HT317"></script>

View File

@ -0,0 +1,156 @@
{% extends "sega.html" %}
{% block title %}Touchscreen{% endblock %}
{% block body %}
<h1>The MaiMai Touchscreen</h1>
<p>The touchscreen for MaiMai, pre-DX, is powered by a {{part("838-15221")|safe}} board, connected to <code>COM3</code>.
</p>
<p>Unlike other IO boards, this board communicates using a custom, text-based, protocol.</p>
<h2 id="serial">Serial configuartion</h2>
<table>
<tr>
<td>Port</td>
<td>COM3</td>
</tr>
<tr>
<td>Baud rate</td>
<td>9600</td>
</tr>
<tr>
<td>Bits per byte</td>
<td>8</td>
</tr>
<tr>
<td>Stop bits</td>
<td>0</td>
</tr>
<tr>
<td>Parity bits</td>
<td>0</td>
</tr>
</table>
<h2 id="packet">Packet format</h2>
<p>As previously mentioned, all packets are text. This means, for the most part, values will stay within a normal
printable range. More importantly, null bytes are not permitted as they will be interpted as the end of the string.
</p>
<p>Packets sent from the game to the board are surrounded in braces, <code>{like this}</code>. Packets sent from the
board to the game are surrounded in parentheses, <code>(like this)</code>.</p>
<h3 id="halt"><code>{HALT}</code></h3>
<table class="code">
<tr>
<td><code>{</code></td>
<td><code>H</code></td>
<td><code>A</code></td>
<td><code>L</code></td>
<td><code>T</code></td>
<td><code>}</code></td>
</tr>
</table>
<p>This instructs the board to stop sending the state of the touchscreen. No response is expected.</p>
<h3 id="stat"><code>{STAT}</code></h3>
<table class="code">
<tr>
<td><code>{</code></td>
<td><code>S</code></td>
<td><code>T</code></td>
<td><code>A</code></td>
<td><code>T</code></td>
<td><code>}</code></td>
</tr>
</table>
<p>This instructs the board to begin sending the state of the touchscreen (detailed below). No response is expected.</p>
<h3 id="xxth"><code>{??th}</code></h3>
<table class="code">
<tr>
<td><code>{</code></td>
<td><code>L</code>/<code>R</code></td>
<td>sensor</td>
<td><code>t</code></td>
<td><code>h</code></td>
<td><code>}</code></td>
</tr>
</table>
<p>This requests the configured threshold value for a specific sensor from the board. The expected response is as
follows:</p>
<table class="code">
<tr>
<td><code>(</code></td>
<td><code>L</code>/<code>R</code></td>
<td>sensor</td>
<td> </td>
<td>threshold value</td>
<td><code>)</code></td>
</tr>
</table>
<h3 id="xxth"><code>{??k?}</code></h3>
<table class="code">
<tr>
<td><code>{</code></td>
<td><code>L</code>/<code>R</code></td>
<td>sensor</td>
<td><code>k</code></td>
<td>threshold</td>
<td><code>}</code></td>
</tr>
</table>
<p>This configures the threshold value for a specific sensor. The expected response is as follows:</p>
<table class="code">
<tr>
<td><code>(</code></td>
<td><code>L</code>/<code>R</code></td>
<td>sensor</td>
<td> </td>
<td> </td>
<td><code>)</code></td>
</tr>
</table>
<h2 id="push">Active mode</h2>
<p>After a <code>{STAT}</code> packet is received, the board enters a mode where it begins constantly transmitting the
state of the touchscreen. The data sent is in the following format:</p>
<table class="code">
<tr>
<td><code>(</code></td>
</tr>
<tr>
<td>P1: A1,B1,A2,B2,x</td>
<td>P1: A3,B3,A4,B4,x</td>
<td>P1: A5,B5,A6,B6,x</td>
<td>P1: A7,B7,A8,B8,C</td>
</tr>
<tr>
<td>padding</td>
<td>padding</td>
</tr>
<tr>
<td>P2: A1,B1,A2,B2,x</td>
<td>P2: A3,B3,A4,B4,x</td>
<td>P2: A5,B5,A6,B6,x</td>
<td>P2: A7,B7,A8,B8,C</td>
</tr>
<tr>
<td>padding</td>
<td>padding</td>
</tr>
<tr>
<td><code>)</code></td>
</tr>
</table>
<p>Each data byte is a bit mask of the 5 values it contains, mapped to <code>1<sub>h</sub></code>,
<code>2<sub>h</sub></code>, <code>4<sub>h</sub></code>, <code>8<sub>h</sub></code>, and <code>10<sub>h</sub></code>
respectively. While sending <code>1f<sub>h</sub></code> would be a valid byte, it is recommended to make use of the
upper bits to keep the value within a printable range. I personally recommend masking with
<code>40<sub>h</sub></code> (<code>'@'</code>) for this purpose. Values will then range from <code>@</code> to
<code>_</code>. Bits indicated with <code>x</code> are unused. It is recommended, but not required, to leave them
unset.
</p>
<p>The four bytes marked as padding are unused, with the only requirement being that they are non-null. It is
recommended, but not required, to set them to <code>40<sub>h</sub></code> (<code>'@'</code>).</p>
{% endblock %}