diff --git a/docs.py b/docs.py index afee6a3..bdabf27 100644 --- a/docs.py +++ b/docs.py @@ -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'{part.name}Part number{part.id}Description{part.description}' + return f'{part.name}ASSY IDSEGA {part.id}Description{part.description}' return f'{id}' diff --git a/styles.css b/styles.css index 99be1b8..43728d1 100644 --- a/styles.css +++ b/styles.css @@ -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); diff --git a/templates/base.html b/templates/base.html index 50bff13..b0e882f 100644 --- a/templates/base.html +++ b/templates/base.html @@ -7,7 +7,7 @@ {% block title %}{% endblock %}{% if self.title() %} | {% endif %}{% block roottitle %}Arcade Reverse Engineering{% endblock %} - + diff --git a/templates/pages/sega/software/touch.html b/templates/pages/sega/software/touch.html new file mode 100644 index 0000000..e99e5e3 --- /dev/null +++ b/templates/pages/sega/software/touch.html @@ -0,0 +1,156 @@ +{% extends "sega.html" %} +{% block title %}Touchscreen{% endblock %} +{% block body %} +

The MaiMai Touchscreen

+ +

The touchscreen for MaiMai, pre-DX, is powered by a {{part("838-15221")|safe}} board, connected to COM3. +

+

Unlike other IO boards, this board communicates using a custom, text-based, protocol.

+ +

Serial configuartion

+ + + + + + + + + + + + + + + + + + + + + +
PortCOM3
Baud rate9600
Bits per byte8
Stop bits0
Parity bits0
+ +

Packet format

+

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. +

+

Packets sent from the game to the board are surrounded in braces, {like this}. Packets sent from the + board to the game are surrounded in parentheses, (like this).

+ +

{HALT}

+ + + + + + + + + +
{HALT}
+

This instructs the board to stop sending the state of the touchscreen. No response is expected.

+

{STAT}

+ + + + + + + + + +
{STAT}
+

This instructs the board to begin sending the state of the touchscreen (detailed below). No response is expected.

+

{??th}

+ + + + + + + + + +
{L/Rsensorth}
+

This requests the configured threshold value for a specific sensor from the board. The expected response is as + follows:

+ + + + + + + + + +
(L/Rsensor threshold value)
+

{??k?}

+ + + + + + + + + +
{L/Rsensorkthreshold}
+

This configures the threshold value for a specific sensor. The expected response is as follows:

+ + + + + + + + + +
(L/Rsensor )
+ +

Active mode

+

After a {STAT} 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:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
(
P1: A1,B1,A2,B2,xP1: A3,B3,A4,B4,xP1: A5,B5,A6,B6,xP1: A7,B7,A8,B8,C
paddingpadding
P2: A1,B1,A2,B2,xP2: A3,B3,A4,B4,xP2: A5,B5,A6,B6,xP2: A7,B7,A8,B8,C
paddingpadding
)
+ +

Each data byte is a bit mask of the 5 values it contains, mapped to 1h, + 2h, 4h, 8h, and 10h + respectively. While sending 1fh 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 + 40h ('@') for this purpose. Values will then range from @ to + _. Bits indicated with x are unused. It is recommended, but not required, to leave them + unset. +

+

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 40h ('@').

+ + +{% endblock %} \ No newline at end of file