From 52971b9a2180ca3a54eb25ab49773e818cb8ae15 Mon Sep 17 00:00:00 2001 From: Loek Le Blansch Date: Sat, 5 Oct 2024 20:19:56 +0200 Subject: more debugging fiddled messages being ignored --- .gitignore | 2 + assets/draw-area.svg | 3 + docs/figs.drawio | 159 ++++++++++++++++++++++++++++++++++++++++++++++ docs/notes.md | 13 +++- docs/time.txt | 1 + experiments/conv/makefile | 5 +- experiments/conv/png2pc | 7 +- melonDS | 2 +- 8 files changed, 187 insertions(+), 5 deletions(-) create mode 100644 assets/draw-area.svg create mode 100644 docs/figs.drawio diff --git a/.gitignore b/.gitignore index b5424e0..ef45c97 100644 --- a/.gitignore +++ b/.gitignore @@ -19,3 +19,5 @@ roms/ copyright/ +# drawio +.$*.bkp diff --git a/assets/draw-area.svg b/assets/draw-area.svg new file mode 100644 index 0000000..8839997 --- /dev/null +++ b/assets/draw-area.svg @@ -0,0 +1,3 @@ + + +
draw area
draw area
24
24
80
80
55
55
16
16
4
4
256
256
\ No newline at end of file diff --git a/docs/figs.drawio b/docs/figs.drawio new file mode 100644 index 0000000..5bb64a2 --- /dev/null +++ b/docs/figs.drawio @@ -0,0 +1,159 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/notes.md b/docs/notes.md index acc9067..fc7c43c 100644 --- a/docs/notes.md +++ b/docs/notes.md @@ -142,8 +142,17 @@ source: screen become visible again in the edit field. This includes the bottom row of pixels, as well as the two rows of pixels shown in the single line message picture. - - The **apparent** drawable area (including obstructed top-left corner) is - 228x80 pixels. + - The drawable area (including obstructed top-left corner) is 228x80 pixels, + while the entire message is actually 256x80 pixels: + + ![](../assets/draw-area.svg) + + The above figure illustrates the area which is 'drawable' (i.e. the area in + which the pen tool works). Fiddled messages that go outside this area are + received normally, but masked slightly differently when re-sent (chunk left + of username label appears to be masked). The actual image data is + unmodified even after being forwarded by normal systems (non-fiddling + systems). Observed package counts (no resends) for messages of different sizes: |draw area|display height|packet#| diff --git a/docs/time.txt b/docs/time.txt index dac4bea..5c9ec3e 100644 --- a/docs/time.txt +++ b/docs/time.txt @@ -27,3 +27,4 @@ 2024-08-31 2h35m: packet decoder 2024-09-01 1h50m: homebrew ds toolchain hello world 2024-10-04 2h10m: reverse message serialization +2024-10-05 1h50m: debugging fiddled messages being ignored diff --git a/experiments/conv/makefile b/experiments/conv/makefile index ae2f70d..2a513c0 100644 --- a/experiments/conv/makefile +++ b/experiments/conv/makefile @@ -1,5 +1,8 @@ %.png: %.bin - ./pc2png $< + venv/bin/python3 pc2png $< + +%.bin: %.png + venv/bin/python3 png2pc $< %.h: %.bin ./bin2h $< > $@ diff --git a/experiments/conv/png2pc b/experiments/conv/png2pc index d1eaab8..21b3b29 100755 --- a/experiments/conv/png2pc +++ b/experiments/conv/png2pc @@ -1,7 +1,7 @@ #!/bin/python3 import itertools import io -from PIL import Image +from PIL import Image, ImageDraw from consts import * from shared import main @@ -37,6 +37,11 @@ def png2pc(data): img = img.convert('RGB') img = img.quantize(palette=palette_img) + draw = ImageDraw.Draw(img) + draw.rectangle(((0, 0), (24, img.height)), fill=0) + draw.rectangle(((252, 0), (256, img.height)), fill=0) + draw.rectangle(((24, 0), (79, 16)), fill=0) + output = b"" for tile_idx in range(tile_count): tile = ( diff --git a/melonDS b/melonDS index e361a45..1609ecb 160000 --- a/melonDS +++ b/melonDS @@ -1 +1 @@ -Subproject commit e361a4510b59b1ab85e2eb98203743b2017246d7 +Subproject commit 1609ecbe1e217c48189e377060b4068de90c594e -- cgit v1.2.3