AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Programmierung allgemein Programmieren allgemein EAccessViolation mit Codeoptimierung
Thema durchsuchen
Ansicht
Themen-Optionen

EAccessViolation mit Codeoptimierung

Ein Thema von turboPASCAL · begonnen am 12. Nov 2005 · letzter Beitrag vom 13. Nov 2005
 
Benutzerbild von turboPASCAL
turboPASCAL

Registriert seit: 8. Mai 2005
Ort: Sondershausen
4.274 Beiträge
 
Delphi 6 Personal
 
#5

Re: EAccessViolation mit Codeoptimierung

  Alt 13. Nov 2005, 10:00
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.
Matti
Meine Software-Projekte - Homepage - Grüße vom Rüsselmops -Mops Mopser
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 17:17 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz