Wie kann man das jetzt ändern ?
Delphi-Quellcode:
var
cptr: PFSOUND_CHANNEL;
procedure FSOUND_Mixer_FPU_Ramp(mixptr: Pointer; len: int; returnaddress: char);
var
count: int;
begin
// static FSOUND_CHANNEL *cptr;
// static int count;
// IMPORTANT no local variables on stack.. we are trashing EBP. static puts values on heap.
if (len <= 0)
then
exit;
mix_numsamples := len;
mix_mixptr := unsignedint(mixptr);
mix_mixbuffend := mix_mixptr + (mix_numsamples
shl 3);
//==============================================================================================
// LOOP THROUGH CHANNELS
//==============================================================================================
for count := 0
to 64 - 1
do
begin
cptr := @_FSOUND_Channel[count];
asm
push ebp
mov ebx, mix_mixptr
mov mix_mixbuffptr, ebx
mov ecx, cptr
mov mix_cptr, ecx
cmp ecx, 0
// if (!cptr) ...
je @MixExit
// ... then skip this channel!
mov ebx, [ecx+FSOUND_CHANNEL.sptr]
// load the correct SAMPLE pointer for this channel
mov mix_sptr, ebx
// store sample pointer away
cmp ebx, 0
// if (!sptr) ...
je @MixExit
// ... then skip this channel!
// get pointer to sample buffer
mov eax, [ebx+FSOUND_SAMPLE.buff]
mov mix_samplebuff, eax
mov ebx, [ecx+FSOUND_CHANNEL.sptr]
Ist möglicherweise unsicher. Das heisst mann müsste das so machen: (nicht lachen bitte)
Delphi-Quellcode:
add ecx, FSOUND_CHANNEL.sptr
mov ebx, [ecx]
PS.: das Programm ist nicht von mir.