nescom icon indicating copy to clipboard operation
nescom copied to clipboard

TrailerParamRoutineWithLength: optional factor

Open nstbayless opened this issue 9 months ago • 0 comments

Before this change, TrailerParamRoutineWithLength N C takes a trailing parameter whose length is given by the Nth byte of the trailing parameter plus C. With this new change, TrailerParamRoutineWithLength N [C] [F] multiples by F before adding C. Default values for C and F are 0 and 1 respectively.

Multiplying by a factor F makes sense if the Nth byte is listing, say, the number of words rather than the number of bytes in the trailing parameter.

Found in the wild in Monster Maker: 7 Sacred Treasures:

CertainlyCode $3D7E4 CallJSRTable
TrailerParamRoutineWithLength $3D7E4 0 1 2

Ideally I could get it to realize that there's a jump table following the Nth byte, but I guess that'd have to be another directive entirely.

nstbayless avatar Apr 27 '24 03:04 nstbayless