>Sorry to post again but can you also please let us know which line Chris?
>Assuming you have VC++ 6.0 (and assuming you don't already know this),
>pressing F5 should run the program in such a way that it will take you to
>the exact line it crashes at. It would also be helpful if you could list 
>the
>call stack (View / Debug Windows / Call Stack). Double-clicking on the
>highest FreeSCI function in the call stack (i.e. where you can actually see
>the code rather than assembler) will take you straight to the crash line.

   Ahh geez. I am sorry. I wasn't thinking when I made that post. (It was 4 
a.m. over here)
   Actually, when it crashes, windows gives me the option to hit okay or 
cancel. If I hit cancel, it recognizes the program was compiled on my 
computer, loads the source code in Visual C++, and points to the exact spot 
that it crashed. (Neat huh?)

Okay. The program bombs after a few notes of the first midi song played. 
(regardless of the game)

Values at crash time are:

note = 60
playing->notes = (hex address of course)
  all index values 0-16 here are set to 0.
playing->playing = 1207959552

It points to sound.c and to this function:

static inline int
add_note_playing(playing_notes_t *playing, int note)
                 /* Returns 0 or a note to suspend */
{
        int retval = 0;

        if (playing->playing >= playing->polyphony) {
                retval = playing->notes[0];
                if (playing->polyphony > 1)
                        memcpy(playing->notes, &(playing->notes[1]), sizeof(byte) * 
(playing->polyphony - 1)); /* Yes, this sucks. */
        } else playing->playing++;

        playing->notes[playing->playing-1] = (unsigned char)note; /* Chris */

        return retval;
}

It points to the line i just commented my name on.

BTW - I haven't been able to look over all of the midi code, but that 
function looks kinda intense. Do you have to do the memcpy stuff in there? 
Again I am not sure exactly what is going on or is required to play the 
midi...but aren't you manually shifting almost each and every note around in 
memory throughout the song?

- Chris

_________________________________________________________________
Chat with friends online, try MSN Messenger: http://messenger.msn.com


Reply via email to