Topics

UTTORI ASM ยท IN DEVELOPMENT

Include modern assets in assembly

Use includeAsset for PNG graphics, WAVE-to-BRR audio, and registered lossless transforms.

includeAsset(path, format, namedOptions...) converts a modern input during a normal assembly build and emits one selected byte stream at the current address. Input paths follow source, macro, and include-path resolution. Its canonical spelling is includeAsset.

TitleTiles:
  includeAsset("art/title.png", "snes.tile.4bpp", palette: "art/title.palette.json", layout: { tileOrder: "row-major" })
TitleTilesEnd:
TitlePalette:
  includeAsset("art/title.png", "4bpp", palette: "art/title.palette.json", output: "palette")
Bell:
  includeAsset("audio/bell.wav", "snes.brr", loop: false, padding: "reject")

Exactly two positional strings are followed by named options. output selects a named part, defaulting to the format primary output. compress applies a registered lossless transform after output selection; maxSize bounds the final stream. The statement does not write generated files or configure VRAM, CGRAM, or audio playback hardware. incbin still copies existing bytes unchanged.

Builds snapshot primary and resource bytes once across passes, track them in debug-map dependencies, and use source spans for diagnostics. Editor analysis resolves input paths without converting large media on each edit. Hover can request a bounded thumbnail; the explicit preview command opens a composed/storage image or source-PCM/decoded-BRR audio player without autoplay. A build remains authoritative for exact addresses after asset statements.

See the SNES source guide for exact palette/layout/loop rules and the runnable example, and standalone conversion for supplied-byte use.