Edit 7: RIOv4_3 reports firmware version 4.3

The VersionReply builder at $C6EA hardcoded 4.2; --reportversion=4.3
patches the minor operand byte ($C6FF: 02->03). Verified no host
software gates on the value (legacy prints it, RIOJoy parses it, native
games ignore it — Cyd). Rebuilt RIOv4_3.bin: 69 bytes vs stock, sha
6d67a2fc7713...; docs updated. Chips burned before this edit still
announce 4.2 — re-burn to pick up the number; all other bytes match
the certified image.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Cyd
2026-07-19 17:20:40 -05:00
co-authored by Claude Fable 5
parent be70e61d07
commit bf3b0f1cc1
5 changed files with 37 additions and 7 deletions
+18
View File
@@ -52,6 +52,14 @@ CHECKREPAINT = "--checkrepaint" in sys.argv
assert not CHECKREPAINT or E0T is not None, \
"--checkrepaint requires --e0thresh (it re-renders E0 via the gated $D5F2)"
# --reportversion=M.N (edit 7): the major.minor bytes the VersionReply returns.
REPORTVER = None
for a in sys.argv:
if a.startswith("--reportversion="):
REPORTVER = tuple(int(x) for x in a.split("=", 1)[1].split("."))
assert len(REPORTVER) == 2 and all(0 <= v <= 127 for v in REPORTVER), \
f"--reportversion must be M.N with 7-bit values: {REPORTVER}"
args = [a for a in sys.argv[1:] if not a.startswith("--")]
SRC = args[0] if len(args) > 0 else "RIOv4_2.bin"
if len(args) > 1:
@@ -165,6 +173,16 @@ if CHECKREPAINT:
0x39] # $E029 RTS
patch(0xE020, [0xFF] * len(cave6), cave6)
# --- edit 7 (--reportversion=M.N): version bytes in the VersionReply --------
# The reply builder at $C6EA loads the payload with LDAA #$04 ($C6F7) and
# LDAA #$02 ($C6FE) — hardcoded "4.2". Nothing host-side validates the value
# (legacy app prints it, RIOJoy parses it, native games ignore it — verified
# by Cyd 2026-07-19), so the christened firmware can announce itself.
if REPORTVER is not None:
assert d[0xC6F7] == 0x86 and d[0xC6FE] == 0x86, "expected LDAA #imm pair at $C6F7/$C6FE"
patch(0xC6F8, [0x04], [REPORTVER[0]])
patch(0xC6FF, [0x02], [REPORTVER[1]])
open(DST, "wb").write(d)
new_sha = hashlib.sha256(d).hexdigest()
# byte-diff report