convert-asset-array
БесплатноБез исполняемых скриптовНе проверенConvert arrays with hardcoded pointer addresses to use ROM_START/ROM_END symbols. This automates the process of adding USE_ASSET declarations, updating array…
от cdlewis★ 200 звёзд на GitHubОб этом скилле
Convert Asset Arrays to ROM Symbols
Overview
When working with data arrays that contain hardcoded ROM pointer addresses (like gCourseDataAssets or gSpriteAssets), you need to:
- Add
USE_ASSETdeclarations for each unique address - Convert the array to use
ROM_START/ROM_ENDsymbols - Update
snowboardkids2.yamlto add named segments with proper end markers
This skill automates that entire process.
When to use
Use this skill when you see arrays with hardcoded pointer addresses like:
Asset_56910 gCourseDataAssets[] = {
{ (void *)0x00224420, (void *)0x00226BA0, 0x000024A8 },
{ (void *)0x0023CB80, (void *)0x00240520, 0x00003468 },
// ...
};
These should be converted to:
Asset_56910 gCourseDataAssets[] = {
{ (void *)&_224420_ROM_START, (void *)&_224420_ROM_END, 0x000024A8 },
{ (void *)&_23CB80_ROM_START, (void *)&_23CB80_ROM_END, 0x00003468 },
// ...
};
How to use
Identify the array to convert
Look for arrays of type Asset_56910 or similar asset structures in src/data/course_data.c or other data files.
Extract the pattern
For each array entry, extract:
- Start address (first pointer value)
- End address (second pointer value)
- Size field (third value, typically ignored for ROM_START/ROM_END)
Step 1: Add USE_ASSET declarations
In include/assets.h, add USE_ASSET declarations for each unique start address:
USE_ASSET(_224420);
USE_ASSET(_23CB80);
USE_ASSET(_24D6C0);
// ... etc, sorted numerically
Step 2: Update the array initialization
Convert the array entries from:
{ (void *)0x00224420, (void *)0x00226BA0, 0x000024A8 }
To:
{ (void *)&_224420_ROM_START, (void *)&_224420_ROM_END, 0x000024A8 }
The pattern is:
- Remove leading
0xand00prefixes from addresses - Replace
(void *)0xADDRESSwith(void *)&_ADDRESS_ROM_STARTor_ROM_END - Keep the size field unchanged
Step 3: Update snowboardkids2.yaml
For each asset segment:
Find the location - Search for the address in the YAML:
grep -n "0x224420\|0x226BA0" snowboardkids2.yamlAdd or convert segments - If you see:
[0x224420, bin]alone → Convert to named segment:- name: _224420 type: bin vram: 0 start: 0x224420Named segment without end marker → Add end marker:
- name: _224420 type: bin vram: 0 start: 0x224420 - [0x226BA0, bin] # This marks where _224420 ENDS
Maintain proper ordering - Ensure segments are in ascending address order:
- Named segment definition
- End marker (next segment's start)
- Next named segment
Example structure:
- name: _224420
type: bin
vram: 0
start: 0x224420
- [0x226BA0, bin] # End marker for _224420, also marks start of next
- name: _23CB80
type: bin
vram: 0
start: 0x23CB80
- [0x240520, bin] # End marker for _23CB80
Step 4: Validate
Build and verify:
./tools/build-and-verify.sh
Watch for errors:
- Segment XXXXX has zero size - End marker followed by named segment at same address (remove redundant end marker)
- Segments out of order - YAML entries not in ascending address order
- Missing USE_ASSET - Undefined ROM_START/ROM_END symbols
- Wrong segment size - End marker at wrong address causing data mismatch
- Checksum mismatch - Use
data_diff.py --find-first-mismatchto find the problematic symbol
Common Patterns
Pattern 1: Single address used by multiple entries
Why: Multiple array entries may reference the same asset (duplicates share data).
Pattern 2: Asset marker already exists as [0xADDRESS, bin]
If multiple array entries use the same start/end addresses (common for duplicate assets), only declare the asset once:
// Both entries 15 and 16 use the same addresses
{ (void *)&_34A2C0_ROM_START, (void *)&_34A2C0_ROM_END, 0x00000438 },
{ (void *)&_34A2C0_ROM_START, (void *)&_34A2C0_ROM_END, 0x00000438 },
Pattern 2: Asset marker already exists as [0xADDRESS, bin]
When you see [0x226BA0, bin] in the YAML:
Add a named segment BEFORE it:
- name: _224420 type: bin vram: 0 start: 0x224420 - [0x226BA0, bin] # End of _224420Convert the marker to a named segment with its own end marker:
- name: _226BA0 type: bin vram: 0 start: 0x226BA0 - [0x228400, bin] # End of _226BA0
Pattern 3: Redundant end markers
WRONG: End marker followed by named segment at same address:
- name: _226BA0
type: bin
vram: 0
start: 0x226BA0
- [0x228400, bin] # REDUNDANT! _228400 starts at same address
- name: _228400
type: bin
vram: 0
start: 0x228400
CORRECT: Named segment serves as boundary:
- name: _226BA0
type: bin
vram: 0
start: 0x226BA0
- name: _228400 # Ends _226BA0, starts at 0x228400
type: bin
Установить convert-asset-array в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл convert-asset-array?
Convert arrays with hardcoded pointer addresses to use ROM_START/ROM_END symbols. This automates the process of adding USE_ASSET declarations, updating array initialization, and configuring YAML segments.
Как установить скилл convert-asset-array?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл convert-asset-array запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic