I've been slowly pecking away at some code I dumped from an EPROM, and I feel if I can work out this section, it will get me that first insight needed to start figuring out another section of code.
nmi_4C1 LDAB SRM_C6
BEQ nmi_50F
TBA
LSRA
LSRA
LSRA
LSRA
BEQ nmi_516
SUBA #$04
BEQ nmi_51E
DECA
BEQ nmi_54B
DECA
BEQ nmi_4DB
DECA
BEQ nmi_4E6
JMP nms_48F
So, before I pour this shard into an assembler and single-step through it 256 times (which has not always been reliable), I thought I'd ask here.
Obviously this takes the value in SRM_C6 and does some math to break out the value into one of several ranges.
I do know that if SRM_C6 = 0, it branches off to nmi_50F, and if SRM_C6 is < 16, it will branch off at nmi_516
Beyond that, I get a little lost trying to figure out the ranges for the next four branching points
Lastly, nms_48F is the "else" case and a path back into the main interrupt loop.