DOOM64-RE

DOOM 64 Reverse Engineering
Log | Files | Refs | README | LICENSE

seqloadr.c (1709B)


      1 /* ULTRA64 LIBRARIES */
      2 #include <ultra64.h>
      3 #include "ultratypes.h"
      4 #include <libaudio.h>
      5 
      6 /* WESS API INCLUDES */
      7 #include "wessapi.h"	// audio stuff...
      8 #include "seqload.h"
      9 #include "soundhw.h"
     10 #include "wessarc.h"
     11 #include "wessseq.h"
     12 
     13 #include "funqueue.h"
     14 
     15 #ifndef NOUSEWESSCODE
     16 
     17 extern module_header	sfile_hdr;				//800b6a60
     18 extern master_status_structure *ref_pm_stat;	//800B6A80
     19 extern char *loaderfile;						//800B6A84
     20 extern int ref_max_seq_num;					    //800B6A88
     21 extern int opencount;							//800B6A8C
     22 extern int(*Error_func)(int, int);				//800B6A90
     23 extern int Error_module;						//800B6A94
     24 extern Wess_File_IO_Struct *fp_seq_file;		//800B6A98
     25 extern int seq_loader_offset;					//800B6A9C
     26 extern int seq_loader_enable;					//800B6AA0
     27 
     28 int wess_seq_range_sizeof(int seqfirst, int numseqs) // 8003A230
     29 {
     30 	int count;
     31 
     32 	count = 0;
     33 	if (seq_loader_enable)
     34 	{
     35 		if (numseqs == 0)
     36 			return 0;
     37 
     38 		while (numseqs--)
     39 		{
     40 			count += wess_seq_sizeof(seqfirst);
     41 			seqfirst++;
     42 			//printf("numseqs %d || seqfirst %d || count %d\n",numseqs, seqfirst, count);
     43 		}
     44 	}
     45 	return (count);
     46 }
     47 
     48 int wess_seq_range_load(int seqfirst, int numseqs, void *memptr) // 8003A2AC
     49 {
     50 	int count;
     51 	char *pmem;
     52 
     53 	pmem = (char *)memptr;
     54 
     55 	count = 0;
     56 	if (seq_loader_enable)
     57 	{
     58 		if (!open_sequence_data())
     59 			return 0;
     60 
     61 		if (!numseqs)
     62 			return 0;
     63 
     64 		while (numseqs--)
     65 		{
     66 			count += wess_seq_load(seqfirst, pmem + count);
     67 			seqfirst += 1;
     68 		}
     69 
     70 		close_sequence_data();
     71 	}
     72 
     73 	return count;
     74 }
     75 
     76 int wess_seq_range_free(int seqfirst, int numseqs) // 8003A35C
     77 {
     78 	if (seq_loader_enable)
     79 	{
     80 		if (numseqs == 0)
     81 			return 0;
     82 
     83 		while (numseqs--)
     84 		{
     85 			wess_seq_free(seqfirst);
     86 			seqfirst++;
     87 		}
     88 
     89 		return 1;
     90 	}
     91 	return 0;
     92 }
     93 
     94 #endif