ewrogers/sgdk-skills

sgdk-multitasking

Schedule spare-time CPU work with SGDK's single user task, including background decompression, procedural calculations, safe publication and cancellation.

소스 보기

사용 방법

  1. 설치 명령을 복사하고 자신의 에이전트 환경에 설치하기 전에 소스 패키지를 확인하세요.
  2. 필요한 도구, 인증 정보, 지원 환경은 원본 문서에서 확인하세요.
  3. 입력과 원하는 산출물을 설명하고 출처와 결과를 대조하세요.
npx skills add https://github.com/ewrogers/sgdk-skills --skill sgdk-multitasking

시작 전 확인

  • 설치에는 모델 구독, API 한도, 파일 접근 권한이 포함되지 않습니다.
  • 별점 수와 설치 수는 활동 지표이며 독립적인 품질·보안 검증이 아닙니다.
원본 Skill 문서

원본 저장소의 제목, 예시, 코드, 표, 링크, 이미지를 유지해 표시합니다.

SGDK multitasking

Use time left after foreground work. The Mega Drive still has one 68000: a background task makes a long calculation interruptible; it does not make that calculation cheaper or guarantee a completion deadline.

Start from the user's game and its existing ownership and frame loop. Spare Time Lab demonstrates execution contracts, not a prescribed game, UI or architecture.

Workflow

  1. Pull ewrogers/sgdk:latest and inspect its task.h, task.s, frame waits and

startup stack setup. Record versions. Online master may differ from the image.

  1. First consider a small bounded step each frame. Use the SDK task when a pure

CPU routine, such as a synchronous decoder, needs to continue across frames without rewriting its internal state machine. Short jobs may not justify it.

  1. Reserve foreground time first: gameplay, input, rendering preparation, audio

commands and VBlank service. Choose a deadline/fallback for late results. A busy foreground may leave the worker no useful time.

  1. Keep one persistent, non-returning callback. Give it an audited stack and one

explicitly owned job. Preserve its PC/stack when holding work; TSK_stop() followed by TSK_userSet() is not pause/resume.

  1. Restrict worker code to immutable inputs and private RAM. Audit every called

routine for global state and hardware access. Keep VDP, DMA, input, audio, allocation and interrupt control in the foreground. Keep ROM mappings stable.

  1. Publish complete output through a documented single-CPU handshake. Cancellation

is a request until the worker acknowledges it. Keep queued DMA sources alive and immutable until the foreground knows transfers have drained.

  1. Test deterministic bytes, rejected requests, cancellation boundaries, retry,

guards and publication. Build release/debug on ARM64 and AMD64. Check actual frame pacing, input, stack headroom and PAL/NTSC behavior in an emulator; console interrupt timing and audio contention still need hardware.

Read SDK execution and stacks before using TSK APIs or combining them with interrupts. Read jobs and ownership when designing the mailbox, cancellation, deadlines and output handoff.

Spare Time Lab unpacks verified APLIB data and computes a weather map while a small foreground activity continues. It includes its own source generator and build instructions; no other installed skill is required.

Boundaries

  • sgdk-compression selects codecs, verifies decoded bytes and measures costs.

This skill controls when CPU work runs; ordinary unpack() remains synchronous to its caller even when that caller is a background task.

  • sgdk-streaming owns caches, residency and bounded graphics uploads. A worker

can prepare bytes; the foreground streaming owner decides when to publish them.

  • sgdk-ai owns detection/pathfinding algorithms; prefer bounded searches before

using spare-time execution. Never apply an obsolete result to a changed world.

  • sgdk-memory, sgdk-performance, sgdk-testing own broader budgets and QA.

Supply stack/buffer costs and completion measurements, not a competing clock.

  • sgdk-raster, sgdk-audio, sgdk-cartridge own raster timing, sound drivers and

bank mappings. A task is not permission to access those subsystems concurrently.

These links describe responsibilities, not mandatory companion installations.

관련 작업

같은 저장소의 Skills

더 많은 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-best-practices

Write or review SGDK C for defined arithmetic, clear module boundaries, resource lifetimes, safe queued transfers and interrupt sharing. Use for implementation quality and project code organization, rather than toolchain setup, game design or performance profiling alone.

설치 수
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일