ewrogers/sgdk-skills

sgdk-best-practices

Write or review SGDK C for defined arithmetic, clear module boundaries, resource lifetimes, safe queued transfers and interrupt sharing.

ソースを見る

使い方

  1. インストールコマンドをコピーし、自分の環境へ導入する前にソースを確認します。
  2. 必要なツール、認証情報、対応環境を原文で確認します。
  3. 入力と成果物を指定し、出力を資料と照合します。
npx skills add https://github.com/ewrogers/sgdk-skills --skill sgdk-best-practices

開始前の確認

  • 導入にはモデル契約、API枠、ファイルへのアクセス許可は含まれません。
  • スター数や導入数は活動の指標であり、独立した品質・安全性試験ではありません。
リポジトリの原文

見出し、例、コード、表、リンク、参照画像を含む原文を表示しています。

SGDK Best Practices

Make the important contracts visible: ranges, units, ownership, lifetime and failure behavior. Preserve the game's existing architecture and creative direction. These are implementation patterns, not a new engine or style guide.

Treat Labs as optional evidence for a specific technique. Explain the contract being reused and adapt it to the game; do not inherit a Lab's controls, progression, scene flow or module layout merely because working code exists. Whole-game copying is appropriate only when the developer asks for it.

Choose the relevant check

alignment, aliasing and byte formats across host and target builds.

borrowed resources and partial initialization without a prescribed layout.

foreground/interrupt responsibilities and the selected compiler's defaults.

decoding, transactional sprite acquisition, and a copied palette upload.

Read the reference that fits the change; do not load every specialist manual. The examples build independently. Other installed SGDK skills are optional: sgdk-project owns setup, sgdk-math numeric representations, sgdk-scenes scene transitions, sgdk-performance profiling, and sgdk-debug fault diagnosis. This skill supplies the C and lifetime contracts underneath those workflows.

Apply a contract, then prove it

Before changing code, identify who calls it and what must remain true. Record units and valid ranges where they are not apparent. Distinguish borrowed data from owned resources and choose a useful response to exhaustion or invalid input. Do not silently change gameplay to accommodate a convenient implementation.

Check unfamiliar APIs against the headers and implementation in the selected ewrogers/sgdk:latest container. Pull it before validation and record the actual SDK/compiler versions. The references were checked against SGDK 2.11 and the container's GCC 16.2.0. C17 is the baseline; isolate SDK/GCC extensions at the boundary rather than assuming desktop and target ABIs match.

Keep public headers focused on the operations callers need. Hide internal state; avoid giving unrelated modules writable globals or raw ownership of SDK objects. A simple struct and a few functions may be sufficient. Preserve an established layout unless moving code solves a concrete dependency problem.

Test boundary values, rejected operations, repeated cleanup and recovery after failure. Run the portable parts as optimized host C, then compile the SDK-facing parts with the real SDK. Use target execution for ABI-sensitive behavior. Mocks check your adapter's contract; they cannot establish what SGDK actually does.

Treat C correctness, SDK requirements and optional conventions separately. Do not impose a universal ban on allocation, require hand-written assembly or copy a Lab's art, music, mood, tuning or genre rules into another project.

タスクに関連する項目

同じリポジトリから

関連する Skills

すべての Skills
ewrogers
コミュニティ

sgdk-ai

Implement enemy behavior in SGDK games with patrol/chase/attack states, sight cones, target selection, bounded pathfinding and staggered updates. Use when enemies see through walls, get stuck, switch targets erratically, return stale paths or cause frame spikes while searching.

導入数
1
GitHub Stars
0
更新日
10月20日
ewrogers
コミュニティ

sgdk-assets

Prepare, import and troubleshoot Mega Drive graphics, palettes, spritesheets, tiles, maps, fonts and audio resources with SGDK ResComp in Docker. Use for .res files, palette or tile budgets, broken imports, sprite cutting and asset pipeline changes.

導入数
1
GitHub Stars
0
更新日
10月20日
ewrogers
コミュニティ

sgdk-cartridge

Plan and implement large SGDK cartridges with Sega/SSF bank switching, FAR resources, pinned shared code and audio, and safe SRAM access. Use when a ROM exceeds the linear address window, stage assets live in separate banks, a FAR pointer becomes invalid, or saving interferes with banked content.

導入数
1
GitHub Stars
0
更新日
10月20日
ewrogers
コミュニティ

sgdk-compression

Choose and validate SGDK asset compression, measure ROM/CPU/RAM trade-offs, and schedule decoding for loading or preloading. Use for packed graphics or data, not general archive formats or replacing SGDK's renderer.

導入数
1
GitHub Stars
0
更新日
10月20日