Skip to content

Act on special control characters in the attribute area - #17

Merged
bubio merged 1 commit into
mainfrom
feat/special-control-characters
Sep 18, 2026
Merged

bubio merged 1 commit into
mainfrom
feat/special-control-characters

Conversation

@bubio

@bubio bubio commented Sep 18, 2026

Copy link
Copy Markdown
Owner

VRAMTEST の差分 #5 (docs/develop/VRAMTEST.md §5.1)。保留していた特殊制御文字を、vraminfo の表どおりに実装します。

ページの読み直しで決まったこと

  • 置ける組: アトリビュート数の項が「アトリビュート数は 1〜20 の範囲。20 以上は指定禁止。特殊制御文字も含む」と書くとおり、特殊制御文字は行のアトリビュート枠を 1 つ使う普通の組で、位置バイトが $E0/$60 (bit7 は LC なのでどちらも桁 96 = 存在しない桁) であることだけが目印。何番目の組かの限定はページのどこにもないので全組を走査します。M88 が最後の組だけを見ているのは、全組を走査する版を #if 0 // XXX: 要検証 で残していることからも分かるとおり未検証の決め打ちです。
  • I は実装しない: ページが実機で「I=1 にした場合は何もおきません」「ステータス N や E が立つように思えますが、実際は 0 のまま」と確かめています。

効果

  • V (bit1): 検出した行より下の表示を止める。取り込みは最後まで走ります。
  • D (bit0): そこで DMA を止める。取り込まなかった行は空白になり、終端カウントに届かないので TC2 が出ず、V1S ではその分 CPU が速くなります。
  • 特殊制御文字の組は属性としては効かなくなりました。今までは制御バイトが属性値として 1 つずれて効いていました。

セーブステートは形式を変えていません。表示停止は DMA バッファから導けるので、ロード時に再計算します。

ページの観測との食い違い (未解決)

ページは「V=1 で画面が点滅、D=1 で画面が消える」と書きますが、表どおりに実装すると V が静止画・D が 2 フレーム周期の点滅になり、2 つの言葉が逆の bit に出ます。D が入れ替わるのはフレーム途中で DMA が止まると次フレームが途中の位置から取り込むためで、#11 (DMA 6000 バイト) と同じ実機確認済みの仕組みです。「表示停止が取り込みも止めるのか」をページが書いていないので、根拠のない側には寄せず表のとおりにしました。詳細は VRAMTEST.md §5.1。

検証

  • 手持ち 1,103 本を 24kHz・60 秒起動して 1.0.5 と画面比較 → 全数ピクセル一致。位置バイトに $E0/$60 を書くゲームは無し。
  • macOS regression 20/20 PASS (参照画像の差し替え無し)。
  • コア単体テスト 923 件 PASS (本 PR で 6 件追加)。Release ビルド・API 互換チェックも通過。
  • テストディスク G で V・D・I を目視確認 (本体側 PR でキー 6 = 置く組の切り替えを追加)。

🤖 Generated with Claude Code

https://claude.ai/code/session_01EtarYVwQy1YVfWGChE5eg4

vraminfo's READ STATUS section: a pair in a row's attribute area whose
position byte is $E0 or $60 is a special control character, and its value
byte carries I (interrupt), V (display stop) and D (DMA stop). VRAMTEST G
showed no effect at all.

The page puts no limit on which slot holds it — the attribute count section
says 「20 以上は指定禁止。特殊制御文字も含む」, so it is one of the row's
attribute slots, told apart by a position byte that names column 96, a column
that cannot exist — so every slot is scanned. M88 looks at the last slot
only, with the loop over all of them left in as `#if 0 // XXX: 要検証`.

V stops the display below the row it sits in; D stops the DMA there, which
also means the terminal count is never reached and the rows that were not
fetched cost the V1S CPU nothing. I is deliberately not implemented: the page
tried it on hardware and 「何もおきません」, with status N and E staying 0.
The pair itself is no longer taken as an attribute value — until now its
control byte shifted every attribute in the row by one slot.

The display stop is derived from the DMA buffer, which the save state already
carries, so the format is unchanged; it is recomputed on load.

Booting all 1,103 disks for 60 emulated seconds each gives a pixel-identical
screen to 1.0.5 everywhere: nothing in the collection writes $E0/$60 as an
attribute position. The macOS regression suite is 20/20.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EtarYVwQy1YVfWGChE5eg4
@bubio
bubio merged commit f7e2742 into main Sep 18, 2026
3 checks passed
@bubio
bubio deleted the feat/special-control-characters branch September 18, 2026 04:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant