Topics

UTTORI ASM · IN DEVELOPMENT

Diagnostics and checks

Use assertions and bounds checks to fail builds at the right source line.

On this page

SNES behavior

Assertions & Explicit Errors

assert sizeof(DMA) == $10, "DMA layout changed"
error "This configuration is not supported"
warnpc $80FFFF

assert condition[, message...] continues when the condition is nonzero and fails otherwise. Message pieces are top-level comma-split and concatenated. Quoted pieces are dequoted. Print helper functions inside messages are not evaluated yet.

error [message...] always fails. warnpc address fails only when the current logical PC is strictly greater than the bound. Despite its historical name, warnpc is an error gate in this implementation.

check

Implemented forms are:

check bankcross off|half|full|on
check title

check title enables read1...read4 without a default value. It does not inspect or validate the ROM title. Any other check form is rejected.

Warnings & Text Output

warnings, print, and warn are currently accepted compatibility no-ops. They produce no user-visible message and do not maintain warning state. dpbase, optimize address ..., asar version, fastrom, and several legacy cleanup directives follow the same no-op policy described below.

There is therefore no stable “all warnings” table equivalent to Asar's manual, and no promise that Asar warning identifiers map to Uttori diagnostics. Errors come from the typed parser, directive handlers, encoders, plugin hooks, and file services. Preserve the complete error text when reporting a failure.

6502 family behavior

assert sizeof(Actor) == 4, "Actor layout changed"   ; native
error "This configuration is not supported"
.warnpc $80FF

.assert 0, error, "bad layout"                     ; ca65: always stops on false

Native assert condition[, message...] continues when the condition is nonzero. ca65 .assert expr[, action[, "message"]] treats a zero result as a hard stop with the quoted message. Warning and link-time assertion actions are not reproduced.

warnpc address fails only when the current logical PC is strictly greater than the bound. Despite its historical name, it is an error gate.

Object-only ca65 directives (.importzp, .exportzp, .globalzp, .forceimport, .autoimport, .constructor, .destructor, .interruptor, .reloc, .debuginfo) throw an explicit diagnostic rather than pretending to work.