diff -Nru aosdk/eng_ssf/eng_ssf.c aosdk_new/eng_ssf/eng_ssf.c --- aosdk/eng_ssf/eng_ssf.c 2007-10-27 16:24:22.000000000 -0700 +++ aosdk_new/eng_ssf/eng_ssf.c 2007-10-28 02:53:01.000000000 -0700 @@ -48,6 +48,7 @@ uint32 offset, plength; uint64 file_len, lib_len, lib_raw_length; corlett_t *lib; + char *libfile; int i; // clear Saturn work RAM before we start scribbling in it @@ -64,34 +65,37 @@ #endif // Get the library file, if any - if (c->lib[0] != 0) - { - uint64 tmp_length; - - #if DEBUG_LOADER - printf("Loading library: %s\n", c->lib); - #endif - if (ao_get_lib(c->lib, &lib_raw_file, &tmp_length) != AO_SUCCESS) + for (i=0; i<9; i++) { + libfile = i ? c->libaux[i-1] : c->lib; + if (libfile[0] != 0) { - return AO_FAIL; - } - lib_raw_length = tmp_length; + uint64 tmp_length; + + #if DEBUG_LOADER + printf("Loading library: %s\n", c->lib); + #endif + if (ao_get_lib(libfile, &lib_raw_file, &tmp_length) != AO_SUCCESS) + { + return AO_FAIL; + } + lib_raw_length = tmp_length; - if (corlett_decode(lib_raw_file, lib_raw_length, &lib_decoded, &lib_len, &lib) != AO_SUCCESS) - { - free(lib_raw_file); - return AO_FAIL; - } + if (corlett_decode(lib_raw_file, lib_raw_length, &lib_decoded, &lib_len, &lib) != AO_SUCCESS) + { + free(lib_raw_file); + return AO_FAIL; + } - // Free up raw file - free(lib_raw_file); + // Free up raw file + free(lib_raw_file); - // patch the file into ram - offset = lib_decoded[0] | lib_decoded[1]<<8 | lib_decoded[2]<<16 | lib_decoded[3]<<24; - memcpy(&sat_ram[offset], lib_decoded+4, lib_len-4); + // patch the file into ram + offset = lib_decoded[0] | lib_decoded[1]<<8 | lib_decoded[2]<<16 | lib_decoded[3]<<24; + memcpy(&sat_ram[offset], lib_decoded+4, lib_len-4); - // Dispose the corlett structure for the lib - we don't use it - free(lib); + // Dispose the corlett structure for the lib - we don't use it + free(lib); + } } // now patch the file into RAM over the libraries @@ -104,7 +108,6 @@ strcpy(psfby, "n/a"); if (c) { - int i; for (i = 0; i < MAX_UNKNOWN_TAGS; i++) { if (!strcasecmp(c->tag_name[i], "psfby"))