Skip to content

Instantly share code, notes, and snippets.

@iamgreaser
Created June 25, 2011 04:13
Show Gist options
  • Save iamgreaser/1046129 to your computer and use it in GitHub Desktop.
Save iamgreaser/1046129 to your computer and use it in GitHub Desktop.
SampleOffset
MOVEQ #0,D0
MOVE.B n_cmdlo(A6),D0
BEQ sononew
MOVE.B D0,n_sampleoffset(A6)
sononew MOVE.B n_sampleoffset(A6),D0
LSL.W #7,D0
CMP.W n_length(A6),D0
BGE sofskip
SUB.W D0,n_length(A6)
LSL.W #1,D0
ADD.L D0,n_start(A6)
RTS
sofskip MOVE.W #$0001,n_length(A6)
RTS
d0 = (u8)n_cmdlo[a6];
if(d0 != 0)
n_sampleoffset[a6] = (u8)d0;
d0 = (u8)n_sampleoffset[a6];
d0 <<= 7;
if((s16)d0 < (s16)n_length[a6])
{
n_length[a6] -= (u16)d0;
d0 <<= 1;
n_start[a6] += (u32)d0;
} else {
n_length[a6] = 1;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment