本文へ移動
cccskills
無料GitHub で公開

zx-spectrum-rom-audit

Validate and implement Sinclair ZX Spectrum 48K ROM-visible behavior in the EMULATORS repository, including reset and restart vectors, IM1/NMI handling, keyboard scanning and repeat, beeper and tape routines, screen/printer output, channels and streams, BASIC tokenization and execution, expression evaluation, memory movement, system variables, calculator stack, floating-point formats, ROM traps, localized ROM selection, and firmware/hardware timing contracts. Use when Codex reviews or edits ZX Spectrum ROM loading, KERNAL-style traps, keyboard, tape, screen, printer, BASIC files, tokens, system variables, startup, interrupts, or compatibility tests.

インストール方法を見る

含まれるファイル(3)

  • SKILL.md5.5 KB
  • agents/openai.yaml227 B
  • references/zx-spectrum-rom.md12.8 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

ZX Spectrum ROM Audit

Core Workflow

Use the 48K ROM as executable specification, while keeping firmware behavior separate from hardware behavior supplied by the ULA and Z80.

  1. Read references/zx-spectrum-rom.md completely before judging behavior.
  2. Inspect .codex/docs/ZXSpectrumROM.pdf for the full annotated control flow, register contracts, tables, algorithms, and routine index. Use the PDF-page locator in the reference.
  3. Identify and hash the actual ROM loaded by the selected emulator. Do not assume that English, Spanish, Nordic, Arabic, prototype, 128K, or replacement ROMs share entry points or data tables.
  4. For the standard English 48K ROM, compare against the canonical 16,384-byte image and verify relevant bytes around every relied-upon entry point.
  5. Inspect the local implementation:
    • include/ZXSpectrum/Memory.hpp, src/ZXSpectrum/Memory.cpp
    • include/ZXSpectrum/ZXSpectrum.hpp, src/ZXSpectrum/ZXSpectrum.cpp
    • include/ZXSpectrum/ZXSpectrumEmulator.hpp, src/ZXSpectrum/ZXSpectrumEmulator.cpp
    • include/ZXSpectrum/PortManager.hpp, src/ZXSpectrum/PortManager.cpp
    • include/ZXSpectrum/FileIO.hpp, src/ZXSpectrum/FileIO.cpp
    • include/ZXSpectrum/Datasette*.hpp, src/ZXSpectrum/Datasette*.cpp
    • include/ZXSpectrum/StdPrinter.hpp, src/ZXSpectrum/StdPrinter.cpp
    • include/ZXSpectrum/ASCIIToCodeConverter.hpp, src/ZXSpectrum/ASCIIToCodeConverter.cpp
    • Z80 interrupt, HALT, flags, stack, block instruction, and I/O behavior under include/FZ80 and src/FZ80
  6. If a trap replaces ROM execution, prove equivalence at entry and exit: registers, flags, alternate registers, stack, PC, memory, system variables, ports, elapsed T-states, interrupts, and error paths.
  7. When changing C++ code, also use $emulators-framework-cpp-style.

Audit Priorities

Prioritize:

  • Reset at 0x0000, restarts, IM1 at 0x0038, NMI at 0x0066, EI delay, HALT release, and stack effects.
  • Keyboard matrix scan, multi-key rejection, shifts, modes, debounce/repeat, LAST_K, FLAGS, and 50/60 Hz dependence.
  • Tape SAVE/LOAD/VERIFY pulse timing, header/data blocks, flags, checksum, BREAK, and failure semantics.
  • Screen address calculation, attributes, control codes, scrolling, lower-screen/editor behavior, channels/streams, and printer routing.
  • Startup RAM probing, RAMTOP/P_RAMT, system-variable initialization, memory workspace movement, and 16K/48K differences.
  • Token tables, syntax checking versus execution, BASIC program representation, variables, calculator stack, integer short form, five-byte floating point, and documented ROM defects.
  • Localized or replacement ROM compatibility only after identifying the concrete image.

Trap Equivalence Checklist

For every accelerated or intercepted routine:

BoundaryVerify
Entryexact PC(s), call versus jump, input registers/flags, expected ROM image
Memoryall reads/writes and ordering, including screen, workspace, stack, and system variables
I/Ocomplete 16-bit port address, edge timing, tape/border/speaker side effects
ExitPC, SP, registers, alternate registers, flags, IFF1/IFF2, error return
TimeT-states, contention, interrupt eligibility, HALT behavior
FailureBREAK, checksum mismatch, out-of-memory, invalid parameter, missing device

Disable the trap automatically when the ROM hash or entry bytes do not match its contract.

Validation Strategy

Use differential execution when possible:

  1. Run the real ROM without traps from a controlled snapshot.
  2. Record instruction, bus, port, memory, system-variable, and timing traces.
  3. Run the accelerated path from the identical snapshot.
  4. Compare all externally observable state at a named synchronization boundary.

Cover reset, held/repeated keys, simultaneous shifts, SAVE/LOAD/VERIFY success and failure, screen controls, scrolling, BASIC editing, numeric edge cases, and 16K versus 48K startup.

Change Guardrails

  • Do not turn descriptive routine labels into a stable ABI across ROM variants.
  • Do not shortcut ROM routines by mutating only the final user-visible value.
  • Do not hide Z80 flag, IFF, refresh, or contention bugs inside ROM-specific workarounds.
  • Do not use host floating point as automatically equivalent to the ROM calculator.
  • Do not normalize documented ROM bugs unless the selected ROM is intentionally patched.
  • Do not infer firmware behavior from a screenshot when system variables, memory layout, timing, or error paths differ.

Audit Report

Report the ROM filename, size, hash, language/version, relevant entry bytes, hardware configuration, trap state, and timing convention. For each finding, cite the disassembly routine/address and distinguish:

  • ROM requirement;
  • ULA/Z80 requirement exposed by the ROM;
  • emulator convenience behavior;
  • intentional compatibility boundary.

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

Validate Commodore 1540/1541/1541C/1541-II compatible disk-drive behavior in EMULATORS, including IEC serial bus protocol, device numbers, KERNAL traps, CBM DOS commands/status, D64 image parsing, BAM/directory/file chains, PETSCII filenames, 6502 drive CPU/ROM/RAM expectations, 6522 VIA wiring, GCR/track/sector geometry, motor/head timing, and compatibility boundaries for 1541-like devices. Use when Codex reviews or edits C64, VIC-20, C264, COMMODORE disk, serial I/O, D64, CBM DOS, IEC, VIA, GCR, or 1541 drive code.

日本語の概要は準備中です。原文の説明を表示しています。

Commnets/EMULATORS102026年10月9日 更新

Validate Commodore 64 CIA 6526 emulation in EMULATORS, including CIA1/CIA2 $DC00/$DD00 register behavior, ports, DDRs, keyboard/joystick matrix, IEC/user port, VIC bank selection, timers A/B, underflow timing, PB toggle/pulse output, TOD clock/alarm, serial shift register, FLAG, ICR masks and IRQ/NMI lines. Use when Codex reviews or edits C64 CIA, timers, ports, keyboard, joystick, serial bus, interrupts, TOD, or VIC bank control.

日本語の概要は準備中です。原文の説明を表示しています。

Commnets/EMULATORS102026年10月9日 更新

Validate Commodore 64 memory map, PLA/bank switching, 6510 port $0000/$0001 behavior, VIC bank selection, color RAM, ROM/RAM overlays, cartridge mapping, and mirrored I/O in the EMULATORS C64 namespace. Use when Codex reviews or edits C64 memory, PLA, CPU-visible address decoding, VIC-visible memory, color memory, char ROM, cartridge, expansion I/O, or mapped chip register behavior.

日本語の概要は準備中です。原文の説明を表示しています。

Commnets/EMULATORS102026年10月9日 更新

Validate Commodore MPS-801 serial dot matrix printer behavior in EMULATORS, including SerialPrinterMPS801 classes and their MatrixPrinterEmulation and SerialPrinterPeripheralSimulation hierarchy, IEC/KERNAL-trap printer routing, device numbers, secondary addresses, PETSCII/character sets, 6x7 glyphs, double width, graphics mode, reverse field, tab and dot positioning, line/page geometry, PostScript output, and fidelity boundaries. Use when Codex reviews or edits COMMODORE MPS801 printer code, generated printer output, PostScript printer templates, C64/VIC-20/C264 serial-printer behavior, or compares implementation against .codex/docs/MPS801.pdf and historical MPS-801 sources.

日本語の概要は準備中です。原文の説明を表示しています。

Commnets/EMULATORS102026年10月9日 更新

Validate Commodore MPS-802 and 1526 serial dot matrix printer behavior in EMULATORS, including SerialPrinterMPS802 classes and their MatrixPrinterEmulation and SerialPrinterPeripheralSimulation hierarchy, IEC/KERNAL-trap printer routing, device numbers, secondary-address functions, PETSCII/character sets, 8x8 glyphs, enhanced width, reverse and paging modes, formatter strings, programmable characters, line/page geometry, PostScript output, and fidelity boundaries. Use when Codex reviews or edits COMMODORE MPS802 printer code, generated printer output, PostScript printer templates, C64/VIC-20/C264 serial-printer behavior, or compares implementation against .codex/docs/MPS802.pdf, the MPS-802 user guide, and 1526/MPS-802/4023 service information.

日本語の概要は準備中です。原文の説明を表示しています。

Commnets/EMULATORS102026年10月9日 更新

Validate Commodore 64 SID 6581/8580 sound emulation in EMULATORS, including $D400-$D7FF register decoding, voices, frequency, pulse width, control bits, ADSR/envelope behavior, oscillator sync/ring/noise/test, filters, volume DAC/sample clicks, paddles, read-only registers, mirrors, and reSID integration. Use when Codex reviews or edits SID, Sound, audio wrapper, register, filter, waveform, envelope, or mapped SID behavior.

日本語の概要は準備中です。原文の説明を表示しています。

Commnets/EMULATORS102026年10月9日 更新

Commnets のスキルをすべて見る

このスキルの問題を報告する