Registriert seit: 8. Mai 2005
Ort: Sondershausen
4.274 Beiträge
Delphi 6 Personal
|
EAccessViolation mit Codeoptimierung
12. Nov 2005, 16:03
Delphi-Quellcode:
type
FSOUND_SAMPLE = record
buff: Punsignedchar; // pointer to sound data
...
end;
PFSOUND_SAMPLE = ^FSOUND_SAMPLE;
FSOUND_CHANNEL = record
index: int; // position in channel pool.
volume: int; // current volume (00-FFh).
frequency: int; // speed or rate of playback in hz.
pan: int; // panning value (00-FFh).
actualvolume: int; // driver level current volume.
actualpan: int; // driver level panning value.
sampleoffset: unsignedint; // sample offset (sample starts playing from here).
sptr: PFSOUND_SAMPLE; // currently playing sample
...
end;
PFSOUND_CHANNEL = ^FSOUND_CHANNEL;
procedure...
...
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
...
Wieso kommt hier eine EAccessViolation ? Wenn ich in den Optionen vom Compiler die Codeoptimierung abschalte {$O-} gibt es keine Probleme.
|
|
Zitat
|