ewrogers/megadev-skills

megadev-raster

Implement bounded HBlank water/reflection and split-screen effects in Megadev Sega CD games, preserving VBlank ownership, interrupt safety and palette/scroll budgets.

소스 보기

사용 방법

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

시작 전 확인

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

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

Megadev raster effects

Use raster effects when the design needs different display state within a frame. Mega CD still uses the Mega Drive VDP: extra CPUs, Word RAM and the ASIC do not add palettes, planes, sprite capacity or a second independent display. The Labs' scenery, audio, controls and split sizes are illustrative.

a handler or changing VDP state during display.

line scroll, palette pairs, camera transforms and seam/sprite budgets.

  • Read Validation for failure tests, regional builds,

emulator checks and physical-hardware limits.

Inspect actual source in ewrogers/megadev:latest. The Lab's rt_* functions and raster_* assembly are application code, not Megadev raster APIs. Do not import SGDK interrupt, DMA-queue or sprite-engine calls.

Essential rules:

  • Reuse the game's VBlank, input, audio and Main/Sub service owners. One owner

schedules VDP access; an H handler must not compete with foreground uploads.

  • Build an immutable frame outside interrupts. Commit its line, scroll, palette

and seam sprites together, then latch a dedicated HBlank plan in VBlank.

  • Restore dry/top state early in VBlank. Program the next counter before bulk

uploads, finish within a measured blank interval, then arm the current epoch. Reject pending blank-edge/early interrupts without consuming that plan.

  • Keep HBlank assembly short and bounded. Save used registers, return with RTE,

and perform no BIOS, C, allocator, CD or decoder calls there. Bound edge polling and interrupt masking; reject late writes rather than coloring another frame.

  • Minimize active-display CRAM writes. Prefer prepared palette banks and line

scroll; if needed, preload a tiny color pair and write on a fresh HBlank. A foam sprite can hide the seam, but cannot excuse an unbounded palette upload.

  • Split-screen shares planes, SAT, palettes and VRAM. Transform and clip sprites

for each view, budget scanlines, and explicitly reserve divider rows.

  • Measure repeated movement and boundary cases, not just a fixed waterline.

Emulator success does not prove CRAM-dot absence or interrupt/bus timing on physical hardware. Offer an effect-off comparison and a simpler fallback.

Raster Labs generate separate water and split discs with scripts/create_project.py --demo water|split. The renderer uploads resident art once and bounds steady-state DMA. Reuse megadev-graphics for general VDP rendering, megadev-system for Main/Sub work, megadev-audio for audio ownership and megadev-performance/megadev-hardware for broader qualification. This skill owns scanline scheduling and the within-frame transforms, not those systems.

관련 작업

같은 저장소의 Skills

더 많은 Skills

모든 Skills