problems 2.8 KB
		      Ultra64 Problems and Tips

* Floating point exceptions
---------------------------
Symptom: The game crashes with a floating point exception in unlikely
places (including code that doesn't appear to use floating point).

Workaround: Get the ultra4 patch on sgi.com that fixes this. FTP to
sgi.com, log in as anonymous and cd to ~/ftp/private. Get ultra4.Z and
link libpatch.a (or libpatch_d.a) into your game before libultra (or
libultra_d).

* Improper thread initialization
---------------------------------
Symptom: Game behaves differently when compiled with libultra.a (instead
of libultra_d.a.) The problem could be due to improper thread
initialization in osCreateThread().

Workaround: Initialize 2 thread structure fields (next and queue)
before calling osCreateThread() as follows:
	
	OSThread t;
	...
	t.next  = (OSThread *)NULL;
	t.queue = (OSThread **)NULL;
	osCreateThread(&t, ...);

* ROM images sent to Nintendo don't work
----------------------------------------
Symptom: ROM images sent to Nintendo don't work on the real hardware
while images run on the development board do.

Fix: Compile with the non-debug library (libultra.a), remove all
printfs and argument parsing code from your game.

* RDP hangs
-----------
Symptom: The scheduler hangs waiting for an RDP interrupt which never
occurs. Audio still runs.

Workaround: If you are running audio, the first thing to try is to set
the flags field for *audio* tasks as follows

    t->list.t.flags  = OS_TASK_DP_WAIT; /* do not set this to 0 */

Note: The RDP will also hang if the display list is corrupted, if the
RDP message queue is too small (and the RDP message is dropped), or if
code overwrites the exception table.

* Sounds Cut Off too early
--------------------------
Symptom: When Sound Player sounds are stopped before they have played
all the way through and the sound is deallocated and another sound is
reallocated with the same id and played, the new sound will be cut off
too early.

Workaround: None. Get a new sndplayer.o from SGI and link it in before
libultra.

* Sequence Player Crash
-----------------------
Symptom: When you call alSeqpStop() followed by alSeqpPlay(), the game
core dumps.

Workaround: Before calling alSeqpStop(), call alSeqpGetProgram() for
each MIDI channel. After alSeqpStop(), call alSeqpSetProgram() for
each MIDI channel.

* TLB exception when initializing Sequence Player
-------------------------------------------------
Symptom: When the audio heap is in its own section (not BSS), the
sequence player crashes in alSeqpNew() in early versions of libultra.

Workaround: Initialize the audio heap to zero.

* Clicks in the audio
---------------------
Symptom: audio occasionally clicks or crashes.

Fix: Make sure that the sound bank data is cache aligned. The easiest
way to do this is to allocate from the audio heap with alHeapAlloc().